/*
 Navicat Premium Data Transfer

 Source Server         : wmes
 Source Server Type    : SQL Server
 Source Server Version : 12005000 (12.00.5000)
 Source Host           : .:1433
 Source Catalog        : WMES
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 12005000 (12.00.5000)
 File Encoding         : 65001

 Date: 15/08/2023 07:13:53
*/


-- ----------------------------
-- Table structure for Base_DefectItem
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_DefectItem]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_DefectItem]
GO

CREATE TABLE [dbo].[Base_DefectItem] (
  [DefectItem_Id] int  IDENTITY(1,1) NOT NULL,
  [DefectItemCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DefectItemName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [ImageUrl] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Attachment] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Base_DefectItem] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品项表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'DefectItem_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品项编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'DefectItemCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品项名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'DefectItemName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良信息',
'SCHEMA', N'dbo',
'TABLE', N'Base_DefectItem'
GO


-- ----------------------------
-- Table structure for Base_DesktopMenu
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_DesktopMenu]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_DesktopMenu]
GO

CREATE TABLE [dbo].[Base_DesktopMenu] (
  [DesktopMenu_Id] int  IDENTITY(1,1) NOT NULL,
  [MenuId] int  NOT NULL,
  [MenuName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [MenuUrl] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Color] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Enable] tinyint  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_DesktopMenu] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主页菜单表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'DesktopMenu_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'菜单',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'MenuId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'菜单名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'MenuName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'路由地址',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'MenuUrl'
GO

EXEC sp_addextendedproperty
'MS_Description', N'背景颜色',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'Color'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'Enable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'首页菜单',
'SCHEMA', N'dbo',
'TABLE', N'Base_DesktopMenu'
GO


-- ----------------------------
-- Table structure for Base_MaterialDetail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_MaterialDetail]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_MaterialDetail]
GO

CREATE TABLE [dbo].[Base_MaterialDetail] (
  [MaterialDetail_Id] int  IDENTITY(1,1) NOT NULL,
  [ParentProduct_Id] int  NOT NULL,
  [ChildProduct_Id] int  NOT NULL,
  [QuantityPer] int  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_MaterialDetail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料清单主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'MaterialDetail_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'父项产品',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'ParentProduct_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'子项产品',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'ChildProduct_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单位用量',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'QuantityPer'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_MaterialDetail',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_MeritPay
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_MeritPay]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_MeritPay]
GO

CREATE TABLE [dbo].[Base_MeritPay] (
  [MeritPay_Id] int  IDENTITY(1,1) NOT NULL,
  [Process_Id] int  NULL,
  [Unit_Id] int  NULL,
  [Product_Id] int  NULL,
  [UnitPrice] decimal(20,3)  NOT NULL,
  [StandardNumber] int  NULL,
  [StandardHour] int  NULL,
  [StandardMin] int  NULL,
  [StandardSec] int  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_MeritPay] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'绩效工资配置主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'MeritPay_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工单位',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'Product_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工资单价(元)',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'UnitPrice'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准效率',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'StandardNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_MeritPay',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_Notice
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_Notice]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_Notice]
GO

CREATE TABLE [dbo].[Base_Notice] (
  [Notice_Id] int  IDENTITY(1,1) NOT NULL,
  [NoticeType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [NoticeTitle] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [NoticeContent] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_Notice] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'通知表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'Notice_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通知类型',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'NoticeType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标题',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'NoticeTitle'
GO

EXEC sp_addextendedproperty
'MS_Description', N'内容',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'NoticeContent'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Notice',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_NumberRule
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_NumberRule]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_NumberRule]
GO

CREATE TABLE [dbo].[Base_NumberRule] (
  [NumberRule_Id] int  IDENTITY(1,1) NOT NULL,
  [FormCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Prefix] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [SubmitTime] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SerialNumber] int  NOT NULL,
  [GenerativeRule] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_NumberRule] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'自定义编号规则主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'NumberRule_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标表单',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'FormCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编号前缀',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'Prefix'
GO

EXEC sp_addextendedproperty
'MS_Description', N'提交时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'SubmitTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流水号',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'SerialNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编号生成规则',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'GenerativeRule'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_NumberRule',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_Process
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_Process]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_Process]
GO

CREATE TABLE [dbo].[Base_Process] (
  [Process_Id] int  IDENTITY(1,1) NOT NULL,
  [ProcessCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProcessName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SubmitWorkLimit] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SubmitWorkMatch] decimal(20,3)  NOT NULL,
  [DefectItem] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_Process] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'ProcessCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'ProcessName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工权限',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'SubmitWorkLimit'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工数配比',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'SubmitWorkMatch'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品项列表',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'DefectItem'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Process',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_ProcessLine
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_ProcessLine]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_ProcessLine]
GO

CREATE TABLE [dbo].[Base_ProcessLine] (
  [ProcessLine_Id] int  IDENTITY(1,1) NOT NULL,
  [ProcessLineCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProcessLineName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_ProcessLine] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'ProcessLine_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'ProcessLineCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'ProcessLineName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLine',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_ProcessLineList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_ProcessLineList]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_ProcessLineList]
GO

CREATE TABLE [dbo].[Base_ProcessLineList] (
  [ProcessLineList_Id] int  IDENTITY(1,1) NOT NULL,
  [ProcessLine_Id] int  NOT NULL,
  [Sequence] int  NOT NULL,
  [ProcessLineType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Process_Id] int  NULL,
  [ProcessLineDown_Id] int  NULL,
  [SubmitWorkMatch] decimal(20,3)  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_ProcessLineList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线工序列表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'ProcessLineList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'ProcessLine_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'顺序',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'Sequence'
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'ProcessLineType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序/工艺路线',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'ProcessLineDown_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工数量配比',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'SubmitWorkMatch'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessLineList',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_ProcessList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_ProcessList]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_ProcessList]
GO

CREATE TABLE [dbo].[Base_ProcessList] (
  [ProcessList_Id] int  IDENTITY(1,1) NOT NULL,
  [Process_Id] int  NOT NULL,
  [DataPointType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DataPointName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_ProcessList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序采集数据主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'ProcessList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'DataPointType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'DataPointName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_ProcessList',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_Product
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_Product]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_Product]
GO

CREATE TABLE [dbo].[Base_Product] (
  [Product_Id] int  IDENTITY(1,1) NOT NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Unit_Id] int  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProductAttribute] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Process_Id] int  NULL,
  [MaxInventory] int  NULL,
  [MinInventory] int  NULL,
  [SafeInventory] int  NULL,
  [InventoryQty] int  NULL,
  [FinishedProduct] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Base_Product] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品定义主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'Product_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'库存单位',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品属性',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'ProductAttribute'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最大库存',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'MaxInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最小库存',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'MinInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'安全库存',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'SafeInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'库存数量',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'InventoryQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'成品图',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'FinishedProduct'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_Product',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Base_WorkShop
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Base_WorkShop]') AND type IN ('U'))
	DROP TABLE [dbo].[Base_WorkShop]
GO

CREATE TABLE [dbo].[Base_WorkShop] (
  [WorkShopId] uniqueidentifier  NOT NULL,
  [WorkShopName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WorkShopCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WorkSpaceType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Parent] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [MainPerson] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Area] int  NULL,
  [Enable] int  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Base_WorkShop] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'车间主键',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'WorkShopId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'车间名称',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'WorkShopName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'车间编码',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'WorkShopCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'空间类型',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'WorkSpaceType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'负责人',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'MainPerson'
GO

EXEC sp_addextendedproperty
'MS_Description', N'面积',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'Area'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'Enable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Base_WorkShop',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Cal_Holiday
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Cal_Holiday]') AND type IN ('U'))
	DROP TABLE [dbo].[Cal_Holiday]
GO

CREATE TABLE [dbo].[Cal_Holiday] (
  [HolidayId] uniqueidentifier  NOT NULL,
  [TheDay] date  NOT NULL,
  [StartDate] datetime  NULL,
  [EndDate] datetime  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [HolidayType] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Cal_Holiday] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'HolidayId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'TheDay'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编组编码',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'StartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组类型',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'EndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Holiday',
'COLUMN', N'HolidayType'
GO


-- ----------------------------
-- Table structure for Cal_Plan
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Cal_Plan]') AND type IN ('U'))
	DROP TABLE [dbo].[Cal_Plan]
GO

CREATE TABLE [dbo].[Cal_Plan] (
  [PlanId] uniqueidentifier  NOT NULL,
  [PlanName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [PlanCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TeamType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [StartDate] date  NULL,
  [EndDate] date  NULL,
  [ShiftType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChangeShiftType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] int  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Cal_Plan] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'排版计划主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'PlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'PlanName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划编码',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'PlanCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组类型',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'TeamType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'StartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'EndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'轮班方式',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'ShiftType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'倒班方式',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'ChangeShiftType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Plan',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Cal_PlanShift
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Cal_PlanShift]') AND type IN ('U'))
	DROP TABLE [dbo].[Cal_PlanShift]
GO

CREATE TABLE [dbo].[Cal_PlanShift] (
  [PlanShiftId] uniqueidentifier  NOT NULL,
  [PlanId] uniqueidentifier  NOT NULL,
  [Sequence] int DEFAULT 1 NULL,
  [PlanShiftName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [StartTime] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [EndTime] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Cal_PlanShift] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划班次主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'PlanShiftId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'PlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'显示顺序',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'Sequence'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班次名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'PlanShiftName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'StartTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'EndTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanShift',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Cal_PlanTeam
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Cal_PlanTeam]') AND type IN ('U'))
	DROP TABLE [dbo].[Cal_PlanTeam]
GO

CREATE TABLE [dbo].[Cal_PlanTeam] (
  [PlanTeamId] uniqueidentifier  NOT NULL,
  [PlanId] uniqueidentifier  NOT NULL,
  [TeamId] uniqueidentifier  NOT NULL,
  [TeamCode] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TeamName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Sequence] int DEFAULT 1 NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Cal_PlanTeam] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划班组主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'PlanTeamId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'PlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'TeamId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组编码',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'TeamCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'TeamName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'显示顺序',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'Sequence'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_PlanTeam',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Cal_Team
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Cal_Team]') AND type IN ('U'))
	DROP TABLE [dbo].[Cal_Team]
GO

CREATE TABLE [dbo].[Cal_Team] (
  [TeamId] uniqueidentifier  NOT NULL,
  [TeamName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TeamCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TeamType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Cal_Team] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'TeamId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'TeamName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编组编码',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'TeamCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组类型',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'TeamType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Cal_Team',
'COLUMN', N'Remark'
GO


-- ----------------------------
-- Table structure for Cal_TeamMember
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Cal_TeamMember]') AND type IN ('U'))
	DROP TABLE [dbo].[Cal_TeamMember]
GO

CREATE TABLE [dbo].[Cal_TeamMember] (
  [TeamMemberId] uniqueidentifier  NOT NULL,
  [TeamId] uniqueidentifier  NOT NULL,
  [User_Id] int  NOT NULL,
  [UserName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [UserTrueName] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [PhoneNo] nvarchar(11) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Cal_TeamMember] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'成员主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'TeamMemberId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'TeamId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'成员',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'User_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'成员名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'UserName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'成员姓名',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'UserTrueName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'电话号码',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'PhoneNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamMember',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Cal_TeamShift
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Cal_TeamShift]') AND type IN ('U'))
	DROP TABLE [dbo].[Cal_TeamShift]
GO

CREATE TABLE [dbo].[Cal_TeamShift] (
  [TeamShiftId] uniqueidentifier  NOT NULL,
  [TheDate] date  NOT NULL,
  [TeamId] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TeamName] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ShiftId] uniqueidentifier  NOT NULL,
  [ShiftName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Sequence] int  NULL,
  [PlanId] uniqueidentifier  NOT NULL,
  [ChangeShiftType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Cal_TeamShift] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组排版主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'TeamShiftId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'日期',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'TheDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'TeamId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班组名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'TeamName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班次主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'ShiftId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班次名称',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'ShiftName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'顺序',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'Sequence'
GO

EXEC sp_addextendedproperty
'MS_Description', N'排班计划主键',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'PlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'轮班方式',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'ChangeShiftType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Cal_TeamShift',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_DevCatalog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_DevCatalog]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_DevCatalog]
GO

CREATE TABLE [dbo].[Equip_DevCatalog] (
  [DevCatalogId] uniqueidentifier  NOT NULL,
  [DevCatalogName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DevCatalogCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Enable] int  NOT NULL,
  [ParentId] uniqueidentifier  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_DevCatalog] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备类型主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'DevCatalogId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备类型名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'DevCatalogName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备类型编码',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'DevCatalogCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'Enable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'父分类',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'ParentId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_DevCatalog',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_Device
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_Device]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_Device]
GO

CREATE TABLE [dbo].[Equip_Device] (
  [DeviceId] uniqueidentifier  NOT NULL,
  [DeviceName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeviceCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeviceBrand] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModelType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkShopId] uniqueidentifier  NULL,
  [ParentId] uniqueidentifier  NOT NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_Device] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'DeviceId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'DeviceName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备编码',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'DeviceCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'品牌',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'DeviceBrand'
GO

EXEC sp_addextendedproperty
'MS_Description', N'规格型号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'ModelType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'所属车间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'WorkShopId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备分类',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'ParentId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Device',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_Fault
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_Fault]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_Fault]
GO

CREATE TABLE [dbo].[Equip_Fault] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [FaultCode] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FaultName] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FaultType] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_Fault] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'FaultCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'FaultName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障类型',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'FaultType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备故障基础信息',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Fault'
GO


-- ----------------------------
-- Table structure for Equip_FaultData
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_FaultData]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_FaultData]
GO

CREATE TABLE [dbo].[Equip_FaultData] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FaultId] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [Description] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Measure] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Star] int  NULL,
  [FaultDate] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] datetime2(7)  NULL,
  [IsClosed] varchar(10) COLLATE Chinese_PRC_CI_AS DEFAULT 0 NULL
)
GO

ALTER TABLE [dbo].[Equip_FaultData] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'FaultId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障描述',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Description'
GO

EXEC sp_addextendedproperty
'MS_Description', N'解决措施',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Measure'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障状态',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'星选数量',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'Star'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障日期',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'FaultDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否关闭',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData',
'COLUMN', N'IsClosed'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备故障数据',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultData'
GO


-- ----------------------------
-- Table structure for Equip_FaultEscalation
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_FaultEscalation]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_FaultEscalation]
GO

CREATE TABLE [dbo].[Equip_FaultEscalation] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [FaultId] int  NULL,
  [EscalationNum] int  NULL,
  [Receiver] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Description] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_FaultEscalation] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation',
'COLUMN', N'FaultId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上升次数',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation',
'COLUMN', N'EscalationNum'
GO

EXEC sp_addextendedproperty
'MS_Description', N'接收人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation',
'COLUMN', N'Receiver'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上升描述',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation',
'COLUMN', N'Description'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备故障升级',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultEscalation'
GO


-- ----------------------------
-- Table structure for Equip_FaultStarLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_FaultStarLog]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_FaultStarLog]
GO

CREATE TABLE [dbo].[Equip_FaultStarLog] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [FaultId] int  NULL,
  [StarUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_FaultStarLog] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultStarLog',
'COLUMN', N'FaultId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'星选人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultStarLog',
'COLUMN', N'StarUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'星选时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultStarLog',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'故障星选日志',
'SCHEMA', N'dbo',
'TABLE', N'Equip_FaultStarLog'
GO


-- ----------------------------
-- Table structure for Equip_MaintainPaper
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_MaintainPaper]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_MaintainPaper]
GO

CREATE TABLE [dbo].[Equip_MaintainPaper] (
  [MaintainPaperId] uniqueidentifier  NOT NULL,
  [MaintainPaperName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [MaintainPaperCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeviceName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeviceCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeviceBrand] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReportDate] date  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_MaintainPaper] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'维修单主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'MaintainPaperId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'维修单名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'MaintainPaperName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'维修单编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'MaintainPaperCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'DeviceName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'DeviceCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'品牌',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'DeviceBrand'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报修日期',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'ReportDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_MaintainPaper',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_SpotMaintenance
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_SpotMaintenance]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_SpotMaintenance]
GO

CREATE TABLE [dbo].[Equip_SpotMaintenance] (
  [SpotMaintenanceId] uniqueidentifier  NOT NULL,
  [SpotMaintenanceName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SpotMaintenanceCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ItemType] int  NOT NULL,
  [Enable] int  NULL,
  [ItemContent] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [ItemStandard] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_SpotMaintenance] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养项目主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'SpotMaintenanceId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'SpotMaintenanceName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目编码',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'SpotMaintenanceCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目类型',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'ItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'Enable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目内容',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'ItemContent'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'ItemStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintenance',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_SpotMaintPlan
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_SpotMaintPlan]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_SpotMaintPlan]
GO

CREATE TABLE [dbo].[Equip_SpotMaintPlan] (
  [SpotMaintPlanId] uniqueidentifier  NOT NULL,
  [SpotMaintPlanName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SpotMaintPlanCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [PlanItemType] int  NOT NULL,
  [GhzQty] int  NOT NULL,
  [GhzQtyLat] int  NOT NULL,
  [StartDate] datetime  NULL,
  [EndDate] datetime  NULL,
  [Status] int  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [NextCheckDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_SpotMaintPlan] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'SpotMaintPlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'SpotMaintPlanName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划编码',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'SpotMaintPlanCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划类型',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'PlanItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'频率',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'GhzQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'StartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'EndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下次截至时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlan',
'COLUMN', N'NextCheckDate'
GO


-- ----------------------------
-- Table structure for Equip_SpotMaintPlanDevice
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_SpotMaintPlanDevice]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_SpotMaintPlanDevice]
GO

CREATE TABLE [dbo].[Equip_SpotMaintPlanDevice] (
  [SpotMaintPlanDeviceId] uniqueidentifier  NOT NULL,
  [SpotMaintPlanId] uniqueidentifier  NOT NULL,
  [DeviceId] uniqueidentifier  NOT NULL,
  [DeviceName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeviceCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeviceBrand] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModelType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_SpotMaintPlanDevice] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养计划设备清单主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'SpotMaintPlanDeviceId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养计划主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'SpotMaintPlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'DeviceId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'DeviceName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备编码',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'DeviceCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'品牌',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'DeviceBrand'
GO

EXEC sp_addextendedproperty
'MS_Description', N'规格型号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'ModelType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanDevice',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_SpotMaintPlanProject
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_SpotMaintPlanProject]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_SpotMaintPlanProject]
GO

CREATE TABLE [dbo].[Equip_SpotMaintPlanProject] (
  [SpotMaintPlanProjectId] uniqueidentifier  NOT NULL,
  [SpotMaintPlanId] uniqueidentifier  NOT NULL,
  [SpotMaintenanceId] uniqueidentifier  NOT NULL,
  [SpotMaintenanceName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SpotMaintenanceCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ItemType] int  NOT NULL,
  [ItemContent] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [ItemStandard] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_SpotMaintPlanProject] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养项目计划主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'SpotMaintPlanProjectId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养项目计划ID',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'SpotMaintPlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'SpotMaintenanceId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'SpotMaintenanceName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目编码',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'SpotMaintenanceCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目类型',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'ItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目内容',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'ItemContent'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'ItemStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintPlanProject',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_SpotMaintWorkOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_SpotMaintWorkOrder]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_SpotMaintWorkOrder]
GO

CREATE TABLE [dbo].[Equip_SpotMaintWorkOrder] (
  [SpotMaintWorkOrderId] uniqueidentifier  NOT NULL,
  [SpotMaintWorkOrderCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SpotMaintPlanId] uniqueidentifier  NOT NULL,
  [SpotMaintPlanName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SpotMaintPlanCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [PlanItemType] int  NOT NULL,
  [PlanStartDate] date  NULL,
  [PlanEndDate] date  NULL,
  [Status] int  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_SpotMaintWorkOrder] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养工单主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'SpotMaintWorkOrderId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'点检保养计划主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'SpotMaintPlanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划名称',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'SpotMaintPlanName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划编码',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'SpotMaintPlanCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划类型',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'PlanItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'PlanStartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'PlanEndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_SpotMaintWorkOrder',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Equip_Status
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Equip_Status]') AND type IN ('U'))
	DROP TABLE [dbo].[Equip_Status]
GO

CREATE TABLE [dbo].[Equip_Status] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Tube] int  NULL,
  [Type] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] int  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] datetime  NULL
)
GO

ALTER TABLE [dbo].[Equip_Status] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管号',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'Tube'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Equipment/Tube',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'Type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'1-运行状态；2-待机状态；3-故障状态；4-保养状态；其它；',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备/管状态',
'SCHEMA', N'dbo',
'TABLE', N'Equip_Status'
GO


-- ----------------------------
-- Table structure for FormCollectionObject
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[FormCollectionObject]') AND type IN ('U'))
	DROP TABLE [dbo].[FormCollectionObject]
GO

CREATE TABLE [dbo].[FormCollectionObject] (
  [FormCollectionId] uniqueidentifier  NOT NULL,
  [FormId] uniqueidentifier  NULL,
  [Title] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [FormData] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[FormCollectionObject] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for FormDesignOptions
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[FormDesignOptions]') AND type IN ('U'))
	DROP TABLE [dbo].[FormDesignOptions]
GO

CREATE TABLE [dbo].[FormDesignOptions] (
  [FormId] uniqueidentifier  NOT NULL,
  [Title] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DaraggeOptions] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [FormOptions] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [FormConfig] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [FormFields] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [TableConfig] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[FormDesignOptions] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Production_AssembleWorkOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_AssembleWorkOrder]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_AssembleWorkOrder]
GO

CREATE TABLE [dbo].[Production_AssembleWorkOrder] (
  [AssembleWorkOrder_Id] int  IDENTITY(1,1) NOT NULL,
  [AssembleWorkOrderCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WorkOrderQty] int  NULL,
  [FinishedQty] int  NULL,
  [FormProcess] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Production_AssembleWorkOrder] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'装配工单主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'AssembleWorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'AssembleWorkOrderCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单数',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'WorkOrderQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已结束工单',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'FinishedQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据进度',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'FormProcess'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrder',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Production_AssembleWorkOrderList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_AssembleWorkOrderList]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_AssembleWorkOrderList]
GO

CREATE TABLE [dbo].[Production_AssembleWorkOrderList] (
  [AssembleWorkOrderList_Id] int  IDENTITY(1,1) NOT NULL,
  [AssembleWorkOrder_Id] int  NOT NULL,
  [LevelPath] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProductAttribute] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Unit_Id] int  NOT NULL,
  [UnitQty] int  NOT NULL,
  [Qty] int  NOT NULL,
  [WorkOrderCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProductionSchedule] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [FinishQty] int  NULL,
  [BadQty] int  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Product_Id] int  NOT NULL,
  [ProcessLine_Id] int  NULL
)
GO

ALTER TABLE [dbo].[Production_AssembleWorkOrderList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'装配工单明细表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'AssembleWorkOrderList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'转配工单',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'AssembleWorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'层级编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'LevelPath'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品属性',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ProductAttribute'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单位',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单位数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'UnitQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'WorkOrderCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产进度',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ProductionSchedule'
GO

EXEC sp_addextendedproperty
'MS_Description', N'完成数',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'FinishQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品数',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'BadQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'Product_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺路线',
'SCHEMA', N'dbo',
'TABLE', N'Production_AssembleWorkOrderList',
'COLUMN', N'ProcessLine_Id'
GO


-- ----------------------------
-- Table structure for Production_InWareHouse
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_InWareHouse]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_InWareHouse]
GO

CREATE TABLE [dbo].[Production_InWareHouse] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Product] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Quality] int  NULL,
  [WorkTime] datetime  NULL,
  [WareHouse] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [Status] int DEFAULT 0 NULL,
  [Signature] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsPass] bit DEFAULT 0 NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_InWareHouse] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'Product'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品质量  1：正常品；0：次品；2：外因；',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'Quality'
GO

EXEC sp_addextendedproperty
'MS_Description', N'使用时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'WorkTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'仓库',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'WareHouse'
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态  0：初始；1：待签字；2：签字完成；',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'签核人',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'Signature'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否通过',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'IsPass'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据是否有效',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'成品入库单',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouse'
GO


-- ----------------------------
-- Table structure for Production_InWareHouseDetail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_InWareHouseDetail]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_InWareHouseDetail]
GO

CREATE TABLE [dbo].[Production_InWareHouseDetail] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [InWareHouseId] int  NULL,
  [CartonNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_InWareHouseDetail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库单',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'InWareHouseId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外箱号',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'CartonNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据是否有效',
'SCHEMA', N'dbo',
'TABLE', N'Production_InWareHouseDetail',
'COLUMN', N'IsEnable'
GO


-- ----------------------------
-- Table structure for Production_MaterialPreparation
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_MaterialPreparation]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_MaterialPreparation]
GO

CREATE TABLE [dbo].[Production_MaterialPreparation] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [Loss] int  NULL,
  [Sort] int  NULL,
  [WorkTime] datetime  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_MaterialPreparation] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'损耗',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'Loss'
GO

EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'Sort'
GO

EXEC sp_addextendedproperty
'MS_Description', N'需求时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'WorkTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否可用',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备料数据',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialPreparation'
GO


-- ----------------------------
-- Table structure for Production_MaterialRequisition
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_MaterialRequisition]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_MaterialRequisition]
GO

CREATE TABLE [dbo].[Production_MaterialRequisition] (
  [Id] int  NOT NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkTime] datetime  NULL,
  [WareHouse] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] int DEFAULT 0 NULL,
  [Signature] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsPass] bit DEFAULT 0 NULL,
  [Qty] int  IDENTITY(1,1) NOT NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_MaterialRequisition] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'使用时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'WorkTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'仓库',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'WareHouse'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态  0：初始；1：待签字；2：签字完成；',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'签核人',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'Signature'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否通过',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'IsPass'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据是否有效',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'请料单',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisition'
GO


-- ----------------------------
-- Table structure for Production_MaterialRequisitionDetail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_MaterialRequisitionDetail]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_MaterialRequisitionDetail]
GO

CREATE TABLE [dbo].[Production_MaterialRequisitionDetail] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [RequisitionId] int  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LotNo] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Supplier] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Vendor] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [Sort] int  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_MaterialRequisitionDetail] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'请料单',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'RequisitionId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'批次号',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'LotNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'供应商',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'Supplier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产商',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'Vendor'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'排序号',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'Sort'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据是否有效',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'请料单详情',
'SCHEMA', N'dbo',
'TABLE', N'Production_MaterialRequisitionDetail'
GO


-- ----------------------------
-- Table structure for Production_ProductPlan
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ProductPlan]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ProductPlan]
GO

CREATE TABLE [dbo].[Production_ProductPlan] (
  [ProductPlan_Id] int  IDENTITY(1,1) NOT NULL,
  [ProductPlanCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Production_ProductPlan] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产计划主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'ProductPlan_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'ProductPlanCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlan',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Production_ProductPlanList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ProductPlanList]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ProductPlanList]
GO

CREATE TABLE [dbo].[Production_ProductPlanList] (
  [ProductPlanList_Id] int  IDENTITY(1,1) NOT NULL,
  [ProductPlan_Id] int  NOT NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkOrderCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NOT NULL,
  [FinishQty] int  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Product_Id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[Production_ProductPlanList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'销售订单产品明细表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'ProductPlanList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产计划',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'ProductPlan_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'WorkOrderCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'完成数',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'FinishQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ProductPlanList',
'COLUMN', N'Product_Id'
GO


-- ----------------------------
-- Table structure for Production_QuarantineQty
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_QuarantineQty]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_QuarantineQty]
GO

CREATE TABLE [dbo].[Production_QuarantineQty] (
  [Id] bigint  IDENTITY(1,1) NOT NULL,
  [TenantId] bigint  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Source] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [SerialNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [QuarantineQty] int  NULL,
  [ReworkNum] int  NULL,
  [ReworkNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DataTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime DEFAULT getdate() NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_QuarantineQty] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据来源 自动采集（auto）/手动录入（keyin）',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'Source'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'SerialNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'QuarantineQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工次数',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'ReworkNum'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'ReworkNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_QuarantineQty'
GO


-- ----------------------------
-- Table structure for Production_Report
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_Report]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_Report]
GO

CREATE TABLE [dbo].[Production_Report] (
  [Id] int  NOT NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Shift] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Product] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InputQty] int  NULL,
  [OutputQty] int  NULL,
  [WorkInQty] int  NULL,
  [WorkOutQty] int  NULL,
  [ScrapQty] int  NULL,
  [QuarantineQty] int  NULL,
  [StopTime] int  NULL,
  [DisInputQty] int  NULL,
  [DisOutputQty] int  NULL,
  [DisWorkInQty] int  NULL,
  [DisWorkOutQty] int  NULL,
  [DisScrapQty] int  NULL,
  [DisQuarantineQty] int  NULL,
  [DisStopTime] int  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Signature] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsPass] bit DEFAULT 0 NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_Report] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班别',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'Shift'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'Product'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'InputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'OutputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'内在制数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'WorkInQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外在制数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'WorkOutQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'碎片数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'ScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'QuarantineQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'停机时长',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'StopTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'DisInputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'DisOutputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'内在制差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'DisWorkInQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外在制差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'DisWorkOutQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'碎片差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'DisScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'DisQuarantineQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'停机时长差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'DisStopTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'签核人',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'Signature'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否通过',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'IsPass'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否可用',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产报工',
'SCHEMA', N'dbo',
'TABLE', N'Production_Report'
GO


-- ----------------------------
-- Table structure for Production_ReportWorkOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ReportWorkOrder]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ReportWorkOrder]
GO

CREATE TABLE [dbo].[Production_ReportWorkOrder] (
  [ReportWorkOrder_Id] int  IDENTITY(1,1) NOT NULL,
  [WorkOrder_Id] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Process_Id] int  NOT NULL,
  [Product_Id] int  NOT NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProcessStatus] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProductUser] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ReportQty] int  NULL,
  [Unit_Id] int  NULL,
  [GoodQty] int  NULL,
  [NoGoodQty] int  NULL,
  [ProcessProgress] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [StartDate] datetime  NULL,
  [EndDate] datetime  NULL,
  [ReoportDurationHour] int  NULL,
  [ReoportDurationMinute] int  NULL,
  [StandardProgress] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ActualProgress] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [RateStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [PriceType] int  NULL,
  [UnitPrice] decimal(20,3)  NULL,
  [GuessPrice] decimal(20,3)  NULL,
  [ApproveStatus] int  NULL,
  [ApproveUser] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReportTime] datetime  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Production_ReportWorkOrder] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ReportWorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'WorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序名称',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'Product_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序状态',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ProcessStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产人员',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ProductUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工数',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ReportQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单位',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'良品数',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'GoodQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品数',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'NoGoodQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序进度',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ProcessProgress'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'StartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'EndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工时长',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ReoportDurationHour'
GO

EXEC sp_addextendedproperty
'MS_Description', N'小时',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ReoportDurationMinute'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准效率',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'StandardProgress'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实际效率',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ActualProgress'
GO

EXEC sp_addextendedproperty
'MS_Description', N'达标率',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'RateStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计价方式',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'PriceType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工资单价',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'UnitPrice'
GO

EXEC sp_addextendedproperty
'MS_Description', N'预计工资',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'GuessPrice'
GO

EXEC sp_addextendedproperty
'MS_Description', N'审批状态',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ApproveStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'审批人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ApproveUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ReportTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrder',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Production_ReportWorkOrderList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ReportWorkOrderList]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ReportWorkOrderList]
GO

CREATE TABLE [dbo].[Production_ReportWorkOrderList] (
  [ReportWorkOrderList_Id] int  IDENTITY(1,1) NOT NULL,
  [ReportWorkOrder_Id] int  NOT NULL,
  [DefectItem] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Qty] int  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Production_ReportWorkOrderList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品项主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'ReportWorkOrderList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'ReportWorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品项',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'DefectItem'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReportWorkOrderList',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Production_Rework
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_Rework]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_Rework]
GO

CREATE TABLE [dbo].[Production_Rework] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TenantId] int  NULL,
  [ReworkNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SourceOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkTime] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Router] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Description] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReworkQty] int  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [Signature] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsPass] bit  NULL,
  [ConfirmTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Production_Rework] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'ReworkNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'原工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'SourceOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'预计重工时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'WorkTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标流程',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'Router'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工描述',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'Description'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'ReworkQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'确认人',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'Signature'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否签核完成',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'IsPass'
GO

EXEC sp_addextendedproperty
'MS_Description', N'确认时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework',
'COLUMN', N'ConfirmTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工',
'SCHEMA', N'dbo',
'TABLE', N'Production_Rework'
GO


-- ----------------------------
-- Table structure for Production_ReworkDetial
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ReworkDetial]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ReworkDetial]
GO

CREATE TABLE [dbo].[Production_ReworkDetial] (
  [Id] int  NOT NULL,
  [TenantId] int  NULL,
  [ReworkNo] int  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SerialNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoxNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CartonNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [PalletNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_ReworkDetial] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'ReworkNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'SerialNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'小盒号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'BoxNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外箱号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'CartonNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'托号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'PalletNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工明细',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkDetial'
GO


-- ----------------------------
-- Table structure for Production_ReworkQty
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ReworkQty]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ReworkQty]
GO

CREATE TABLE [dbo].[Production_ReworkQty] (
  [Id] bigint  IDENTITY(1,1) NOT NULL,
  [TenantId] bigint  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Source] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [SerialNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReworkQty] int  NULL,
  [ReworkNum] int  NULL,
  [ReworkNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DataTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime DEFAULT getdate() NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_ReworkQty] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据来源 自动采集（auto）/手动录入（keyin）',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'Source'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'SerialNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'ReworkQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工次数',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'ReworkNum'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'ReworkNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_ReworkQty'
GO


-- ----------------------------
-- Table structure for Production_SalesOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_SalesOrder]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_SalesOrder]
GO

CREATE TABLE [dbo].[Production_SalesOrder] (
  [SalesOrder_Id] int  IDENTITY(1,1) NOT NULL,
  [SalesOrderCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Production_SalesOrder] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'销售订单主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'SalesOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单据编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'SalesOrderCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrder',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Production_SalesOrderList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_SalesOrderList]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_SalesOrderList]
GO

CREATE TABLE [dbo].[Production_SalesOrderList] (
  [SalesOrderList_Id] int  IDENTITY(1,1) NOT NULL,
  [SalesOrder_Id] int  NOT NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkOrderCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NOT NULL,
  [FinishQty] int  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Product_Id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[Production_SalesOrderList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'销售订单产品明细表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'SalesOrderList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'销售订单',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'SalesOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'WorkOrderCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'完成数',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'FinishQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_SalesOrderList',
'COLUMN', N'Product_Id'
GO


-- ----------------------------
-- Table structure for Production_Scrap
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_Scrap]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_Scrap]
GO

CREATE TABLE [dbo].[Production_Scrap] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TenantId] int  NULL,
  [ScrapNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Router] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Description] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [ScrapQty] int  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [Signature] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsPass] bit  NULL,
  [ConfirmTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Production_Scrap] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'ScrapNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标流程',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'Router'
GO

EXEC sp_addextendedproperty
'MS_Description', N'目标工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工描述',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'Description'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'ScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'确认人',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'Signature'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否签核完成',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'IsPass'
GO

EXEC sp_addextendedproperty
'MS_Description', N'确认时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap',
'COLUMN', N'ConfirmTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工',
'SCHEMA', N'dbo',
'TABLE', N'Production_Scrap'
GO


-- ----------------------------
-- Table structure for Production_ScrapDetial
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ScrapDetial]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ScrapDetial]
GO

CREATE TABLE [dbo].[Production_ScrapDetial] (
  [Id] int  NOT NULL,
  [TenantId] int  NULL,
  [ScrapNo] int  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SerialNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoxNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CartonNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [PalletNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_ScrapDetial] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'ScrapNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'SerialNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'小盒号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'BoxNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外箱号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'CartonNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'托号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'PalletNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工明细',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapDetial'
GO


-- ----------------------------
-- Table structure for Production_ScrapQty
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ScrapQty]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ScrapQty]
GO

CREATE TABLE [dbo].[Production_ScrapQty] (
  [Id] bigint  IDENTITY(1,1) NOT NULL,
  [TenantId] bigint  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Source] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ScrapNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SerialNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ScrapQty] int  NULL,
  [ReworkNum] int  NULL,
  [ReworkNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DataTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime DEFAULT getdate() NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_ScrapQty] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据来源 自动采集（auto）/手动录入（keyin）',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'Source'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'ScrapNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'SerialNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'ScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工次数',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'ReworkNum'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工单号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'ReworkNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScrapQty'
GO


-- ----------------------------
-- Table structure for Production_ScreenPrintPlateRecord
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_ScreenPrintPlateRecord]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_ScreenPrintPlateRecord]
GO

CREATE TABLE [dbo].[Production_ScreenPrintPlateRecord] (
  [Id] bigint  NOT NULL,
  [TenantId] bigint  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [PrintPlateNo] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpTime] datetime  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int DEFAULT 1 NULL,
  [CreatedTime] datetime DEFAULT getdate() NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_ScreenPrintPlateRecord] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'印板号',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'PrintPlateNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上线时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'UpTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料信息',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'网版上料记录',
'SCHEMA', N'dbo',
'TABLE', N'Production_ScreenPrintPlateRecord'
GO


-- ----------------------------
-- Table structure for Production_SizeRecord
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_SizeRecord]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_SizeRecord]
GO

CREATE TABLE [dbo].[Production_SizeRecord] (
  [Id] bigint  NOT NULL,
  [TenantId] bigint  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SizeNo] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpTime] datetime  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] float(53) DEFAULT 0 NULL,
  [CreatedTime] datetime DEFAULT getdate() NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_SizeRecord] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'浆料号',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'SizeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上线时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'UpTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料信息',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'浆料上料记录',
'SCHEMA', N'dbo',
'TABLE', N'Production_SizeRecord'
GO


-- ----------------------------
-- Table structure for Production_StatementDefect
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_StatementDefect]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_StatementDefect]
GO

CREATE TABLE [dbo].[Production_StatementDefect] (
  [Id] bigint  NOT NULL,
  [TenantId] bigint  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Shift] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Defect] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_StatementDefect] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班次',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'Shift'
GO

EXEC sp_addextendedproperty
'MS_Description', N'异常',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'Defect'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产异常记录',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementDefect'
GO


-- ----------------------------
-- Table structure for Production_StatementEfficiency
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_StatementEfficiency]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_StatementEfficiency]
GO

CREATE TABLE [dbo].[Production_StatementEfficiency] (
  [Id] bigint  NOT NULL,
  [TenantId] bigint  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Efficiency] float(53)  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [IsEnable] bit DEFAULT 1 NULL,
  [Shift] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Production_StatementEfficiency] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'效率',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'Efficiency'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班次',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency',
'COLUMN', N'Shift'
GO

EXEC sp_addextendedproperty
'MS_Description', N'效率统计',
'SCHEMA', N'dbo',
'TABLE', N'Production_StatementEfficiency'
GO


-- ----------------------------
-- Table structure for Production_StockTaking
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_StockTaking]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_StockTaking]
GO

CREATE TABLE [dbo].[Production_StockTaking] (
  [Id] int  NOT NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Product] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReceiveQty] int  NULL,
  [InputQty] int  NULL,
  [OutputQty] int  NULL,
  [RejectQty] int  NULL,
  [SurplusQty] int  NULL,
  [DisReceiveQty] int  NULL,
  [DisInputQty] int  NULL,
  [DisOutputQty] int  NULL,
  [DisRejectQTy] int  NULL,
  [DisSurplusQty] int  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpdatedTime] datetime  NULL,
  [UpdatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Shift] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Signature] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsPass] bit DEFAULT 0 NULL,
  [IsEnable] bit DEFAULT 1 NULL
)
GO

ALTER TABLE [dbo].[Production_StockTaking] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'Product'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料号',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'接收数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'ReceiveQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'InputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'OutputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'拒绝数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'RejectQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结余数量',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'SurplusQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'接收差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'DisReceiveQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'DisInputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'DisOutputQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'拒绝差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'DisRejectQTy'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结余差异',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'DisSurplusQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新人',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'UpdatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班次',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'Shift'
GO

EXEC sp_addextendedproperty
'MS_Description', N'签核人',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'Signature'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否通过',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'IsPass'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否可用',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班次物料盘点',
'SCHEMA', N'dbo',
'TABLE', N'Production_StockTaking'
GO


-- ----------------------------
-- Table structure for Production_WorkOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_WorkOrder]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_WorkOrder]
GO

CREATE TABLE [dbo].[Production_WorkOrder] (
  [WorkOrder_Id] int  IDENTITY(1,1) NOT NULL,
  [WorkOrderCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Product_Id] int  NOT NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Unit_Id] int  NOT NULL,
  [AssociatedForm] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [FromType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [PlanStartDate] datetime  NOT NULL,
  [PlanEndDate] datetime  NOT NULL,
  [PlanQty] int  NOT NULL,
  [RealQty] int  NOT NULL,
  [GoodQty] int  NOT NULL,
  [NoGoodQty] int  NOT NULL,
  [ReportTime] datetime  NULL,
  [ProductionSchedule] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ActualStartDate] datetime  NULL,
  [ActualEndDate] datetime  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Production_WorkOrder] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'WorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'WorkOrderCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'Product_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单位',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'关联单据',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'AssociatedForm'
GO

EXEC sp_addextendedproperty
'MS_Description', N'来源类型',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'FromType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'PlanStartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'PlanEndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划数',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'PlanQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实际数',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'RealQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'良品数',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'GoodQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品数',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'NoGoodQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工时长',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ReportTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产进度',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ProductionSchedule'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实际开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ActualStartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实际结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ActualEndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrder',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Production_WorkOrderList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Production_WorkOrderList]') AND type IN ('U'))
	DROP TABLE [dbo].[Production_WorkOrderList]
GO

CREATE TABLE [dbo].[Production_WorkOrderList] (
  [WorkOrderList_Id] int  IDENTITY(1,1) NOT NULL,
  [Process_Id] int  NOT NULL,
  [ProcessName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProcessCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SubmitWorkLimit] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [SubmitWorkMatch] decimal(20,3)  NOT NULL,
  [DefectItem] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [DistributionList] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [PlanStartDate] datetime  NOT NULL,
  [PlanEndDate] datetime  NOT NULL,
  [PlanQty] int  NOT NULL,
  [GoodQty] int  NOT NULL,
  [NoGoodQty] int  NOT NULL,
  [ActualStartDate] datetime  NULL,
  [ActualEndDate] datetime  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [WorkOrder_Id] int  NOT NULL,
  [WorkOrderCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Production_WorkOrderList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'任务主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'WorkOrderList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序名称',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'ProcessName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'ProcessCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工权限',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'SubmitWorkLimit'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报工数配比',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'SubmitWorkMatch'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品项列表',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'DefectItem'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分配列表',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'DistributionList'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'PlanStartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'PlanEndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'计划数',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'PlanQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'良品数',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'GoodQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良品数',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'NoGoodQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实际开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'ActualStartDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实际结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'ActualEndDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'WorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单编号',
'SCHEMA', N'dbo',
'TABLE', N'Production_WorkOrderList',
'COLUMN', N'WorkOrderCode'
GO


-- ----------------------------
-- Table structure for Quality_Defect
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_Defect]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_Defect]
GO

CREATE TABLE [dbo].[Quality_Defect] (
  [DefectId] int  IDENTITY(1,1) NOT NULL,
  [DefectName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DefectType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DefectLevel] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Quality_Defect] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'DefectId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项描述',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'DefectName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项类型',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'DefectType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'缺陷等级',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'DefectLevel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不良信息',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Defect'
GO


-- ----------------------------
-- Table structure for Quality_GbExtract
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_GbExtract]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_GbExtract]
GO

CREATE TABLE [dbo].[Quality_GbExtract] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [ExtractName] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractMaxQty] int  NULL,
  [ExtractMinQty] int  NULL,
  [StandQty] int  NULL,
  [Remark] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [NextCheckDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_GbExtract] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'ExtractName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最大数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'ExtractMaxQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最小数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'ExtractMinQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'StandQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下次截至时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract',
'COLUMN', N'NextCheckDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽测标准',
'SCHEMA', N'dbo',
'TABLE', N'Quality_GbExtract'
GO


-- ----------------------------
-- Table structure for Quality_InComingCheck
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_InComingCheck]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_InComingCheck]
GO

CREATE TABLE [dbo].[Quality_InComingCheck] (
  [InComingCheckId] int  IDENTITY(1,1) NOT NULL,
  [InComingCheckName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [InComingCheckCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Product_Id] int  NOT NULL,
  [ProductName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReciveNumber] int  NOT NULL,
  [CheckNumber] int  NOT NULL,
  [DisStandNumber] int  NULL,
  [InComingDate] date  NOT NULL,
  [CheckDate] date  NOT NULL,
  [Result] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_InComingCheck] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'来料检验单主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'InComingCheckId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验单名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'InComingCheckName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验单编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'InComingCheckCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'规格型号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'本次接收数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'ReciveNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'本次检验数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'CheckNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不合格数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'DisStandNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'来料日期',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'InComingDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测日期',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'CheckDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测结果',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'Result'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'来料检',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheck'
GO


-- ----------------------------
-- Table structure for Quality_InComingCheckTestItem
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_InComingCheckTestItem]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_InComingCheckTestItem]
GO

CREATE TABLE [dbo].[Quality_InComingCheckTestItem] (
  [InComingCheckTestItemId] int  IDENTITY(1,1) NOT NULL,
  [InComingCheckId] int  NOT NULL,
  [TemplateTestItemId] int  NOT NULL,
  [TemplateId] int  NOT NULL,
  [TestItemId] int  NOT NULL,
  [TestItemName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [QCTool] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CheckMethod] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [StanderValue] decimal(12,2)  NULL,
  [ThresholdMax] decimal(12,2)  NULL,
  [ThresholdMin] decimal(12,2)  NULL,
  [CrQuantity] int DEFAULT 0 NULL,
  [MajQuantity] int DEFAULT 0 NULL,
  [MinQuantity] int DEFAULT 0 NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_InComingCheckTestItem] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'来料检验单检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'InComingCheckTestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'来料检验单主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'InComingCheckId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验模版检验项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'TemplateTestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'TemplateId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'TestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'TestItemName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'TestItemCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项类型',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'TestItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测工具',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'QCTool'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测要求',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'CheckMethod'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准值',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'StanderValue'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差上限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'ThresholdMax'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差下限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'ThresholdMin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'致命缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'CrQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'严重缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'MajQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'轻微缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'MinQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'来料检测项',
'SCHEMA', N'dbo',
'TABLE', N'Quality_InComingCheckTestItem'
GO


-- ----------------------------
-- Table structure for Quality_OutCheck
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_OutCheck]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_OutCheck]
GO

CREATE TABLE [dbo].[Quality_OutCheck] (
  [OutCheckId] int  IDENTITY(1,1) NOT NULL,
  [OutCheckName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [OutCheckCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Product_Id] int  NOT NULL,
  [ProductName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutNumber] int  NOT NULL,
  [CheckNumber] int  NOT NULL,
  [DisStandNumber] int  NULL,
  [OutDate] date  NOT NULL,
  [CheckDate] date  NOT NULL,
  [Result] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_OutCheck] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库检验单主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'OutCheckId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验单名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'OutCheckName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验单编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'OutCheckCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'规格型号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'发货数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'OutNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'CheckNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不合格数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'DisStandNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出货日期',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'OutDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测日期',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'CheckDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测结果',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'Result'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库检',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheck'
GO


-- ----------------------------
-- Table structure for Quality_OutCheckTestItem
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_OutCheckTestItem]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_OutCheckTestItem]
GO

CREATE TABLE [dbo].[Quality_OutCheckTestItem] (
  [OutCheckTestItemId] int  IDENTITY(1,1) NOT NULL,
  [OutCheckId] int  NOT NULL,
  [TemplateTestItemId] int  NOT NULL,
  [TemplateId] int  NOT NULL,
  [TestItemId] int  NOT NULL,
  [TestItemName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [QCTool] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CheckMethod] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [StanderValue] decimal(12,2)  NULL,
  [ThresholdMax] decimal(12,2)  NULL,
  [ThresholdMin] decimal(12,2)  NULL,
  [CrQuantity] int DEFAULT 0 NULL,
  [MajQuantity] int DEFAULT 0 NULL,
  [MinQuantity] int DEFAULT 0 NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_OutCheckTestItem] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'出货检验单检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'OutCheckTestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出货检验单主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'OutCheckId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验模版检验项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'TemplateTestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'TemplateId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'TestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'TestItemName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'TestItemCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项类型',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'TestItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测工具',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'QCTool'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测要求',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'CheckMethod'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准值',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'StanderValue'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差上限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'ThresholdMax'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差下限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'ThresholdMin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'致命缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'CrQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'严重缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'MajQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'轻微缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'MinQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库检验项',
'SCHEMA', N'dbo',
'TABLE', N'Quality_OutCheckTestItem'
GO


-- ----------------------------
-- Table structure for Quality_ProcessCheck
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_ProcessCheck]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_ProcessCheck]
GO

CREATE TABLE [dbo].[Quality_ProcessCheck] (
  [ProcessCheckId] int  IDENTITY(1,1) NOT NULL,
  [ProcessCheckName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProcessCheckCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CheckType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WorkOrder_Id] int  NOT NULL,
  [WorkOrderCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Product_Id] int  NOT NULL,
  [ProductName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process_Id] int  NULL,
  [ProcessCode] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProcessName] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [StandNumber] int  NULL,
  [DisStandNumber] int  NULL,
  [CrQuantity] int  NULL,
  [MajQuantity] int  NULL,
  [MinQuantity] int  NULL,
  [CheckDate] date  NOT NULL,
  [Result] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_ProcessCheck] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'过程检验单主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProcessCheckId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验单名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProcessCheckName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验单编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProcessCheckCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验类型',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'CheckType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'WorkOrder_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'WorkOrderCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'Product_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'规格型号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'Process_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProcessCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ProcessName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'合格品数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'StandNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'不合格数',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'DisStandNumber'
GO

EXEC sp_addextendedproperty
'MS_Description', N'致命缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'CrQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'严重缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'MajQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'轻微缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'MinQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测日期',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'CheckDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测结果',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'Result'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'过程检',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheck'
GO


-- ----------------------------
-- Table structure for Quality_ProcessCheckTestItem
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_ProcessCheckTestItem]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_ProcessCheckTestItem]
GO

CREATE TABLE [dbo].[Quality_ProcessCheckTestItem] (
  [ProcessCheckTestItemId] int  IDENTITY(1,1) NOT NULL,
  [ProcessCheckId] int  NOT NULL,
  [TemplateTestItemId] int  NOT NULL,
  [TemplateId] int  NOT NULL,
  [TestItemId] int  NOT NULL,
  [TestItemName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [QCTool] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CheckMethod] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [StanderValue] decimal(12,2)  NULL,
  [ThresholdMax] decimal(12,2)  NULL,
  [ThresholdMin] decimal(12,2)  NULL,
  [CrQuantity] int DEFAULT 0 NULL,
  [MajQuantity] int DEFAULT 0 NULL,
  [MinQuantity] int DEFAULT 0 NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_ProcessCheckTestItem] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'过程检验单检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'ProcessCheckTestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'过程检验单主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'ProcessCheckId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验模版检验项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'TemplateTestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'TemplateId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'TestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'TestItemName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'TestItemCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项类型',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'TestItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测工具',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'QCTool'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测要求',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'CheckMethod'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准值',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'StanderValue'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差上限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'ThresholdMax'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差下限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'ThresholdMin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'致命缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'CrQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'严重缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'MajQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'轻微缺陷数量',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'MinQuantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'过程检验项',
'SCHEMA', N'dbo',
'TABLE', N'Quality_ProcessCheckTestItem'
GO


-- ----------------------------
-- Table structure for Quality_Template
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_Template]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_Template]
GO

CREATE TABLE [dbo].[Quality_Template] (
  [TemplateId] int  IDENTITY(1,1) NOT NULL,
  [TemplateName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TemplateCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [QcType] varchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Enable] int  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [NextCheckDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Quality_Template] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'TemplateId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'TemplateName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'TemplateCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测种类',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'QcType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'Enable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下次截至时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template',
'COLUMN', N'NextCheckDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质检模板',
'SCHEMA', N'dbo',
'TABLE', N'Quality_Template'
GO


-- ----------------------------
-- Table structure for Quality_TemplateProduct
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_TemplateProduct]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_TemplateProduct]
GO

CREATE TABLE [dbo].[Quality_TemplateProduct] (
  [TemplateProductId] int  IDENTITY(1,1) NOT NULL,
  [TemplateId] int  NOT NULL,
  [ProductId] int  NOT NULL,
  [ProductName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductCode] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CheckMin] int  NULL,
  [DisQualityMax] int  NULL,
  [CrRate] decimal(12,2)  NULL,
  [MajRate] decimal(12,2)  NULL,
  [MinRate] decimal(12,2)  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ExtractId] int  NULL
)
GO

ALTER TABLE [dbo].[Quality_TemplateProduct] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测模版产品主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'TemplateProductId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'TemplateId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'ProductId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品型号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最低检测数',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'CheckMin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最大不合格数',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'DisQualityMax'
GO

EXEC sp_addextendedproperty
'MS_Description', N'致命缺陷率',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'CrRate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'严重缺陷率',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'MajRate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'轻微缺陷率',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'MinRate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检标准',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct',
'COLUMN', N'ExtractId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品质检模板',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateProduct'
GO


-- ----------------------------
-- Table structure for Quality_TemplateTestItem
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_TemplateTestItem]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_TemplateTestItem]
GO

CREATE TABLE [dbo].[Quality_TemplateTestItem] (
  [TemplateTestItemId] int  IDENTITY(1,1) NOT NULL,
  [TemplateId] int  NOT NULL,
  [TestItemId] int  NOT NULL,
  [TestItemName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [TestItemType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [QCTool] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CheckMethod] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [StanderValue] float(53)  NULL,
  [ThresholdMax] float(53)  NULL,
  [ThresholdMin] float(53)  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [Ucl] float(53)  NULL,
  [Lcl] float(53)  NULL,
  [Cp] float(53)  NULL
)
GO

ALTER TABLE [dbo].[Quality_TemplateTestItem] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测模版检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'TemplateTestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'模版主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'TemplateId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'TestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'TestItemName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'TestItemCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项类型',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'TestItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测工具',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'QCTool'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测要求',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'CheckMethod'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准值(SD)',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'StanderValue'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差上限(USL)',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'ThresholdMax'
GO

EXEC sp_addextendedproperty
'MS_Description', N'误差下限(LSL)',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'ThresholdMin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上控制限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'Ucl'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下控制限',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'Lcl'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标准差',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem',
'COLUMN', N'Cp'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质检模板检验项',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TemplateTestItem'
GO


-- ----------------------------
-- Table structure for Quality_TestItem
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Quality_TestItem]') AND type IN ('U'))
	DROP TABLE [dbo].[Quality_TestItem]
GO

CREATE TABLE [dbo].[Quality_TestItem] (
  [TestItemId] int  IDENTITY(1,1) NOT NULL,
  [TestItemCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TestItemName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [TestItemType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [QCTool] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Quality_TestItem] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项主键',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'TestItemId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项编码',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'TestItemCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项名称',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'TestItemName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测项类型',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'TestItemType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检测工具',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'QCTool'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质量检测项',
'SCHEMA', N'dbo',
'TABLE', N'Quality_TestItem'
GO


-- ----------------------------
-- Table structure for Sys_City
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_City]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_City]
GO

CREATE TABLE [dbo].[Sys_City] (
  [CityId] int  IDENTITY(1,1) NOT NULL,
  [CityCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [CityName] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ProvinceCode] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Sys_City] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_Dept
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Dept]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_Dept]
GO

CREATE TABLE [dbo].[Sys_Dept] (
  [Dept_Id] int  IDENTITY(1,1) NOT NULL,
  [DeptName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeptCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DeptType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Parent] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_Dept] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'部门表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'Dept_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'部门名称',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'DeptName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'部门编码',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'DeptCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织类型',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'DeptType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上级',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'Parent'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Dept',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Sys_Dictionary
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Dictionary]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_Dictionary]
GO

CREATE TABLE [dbo].[Sys_Dictionary] (
  [Dic_ID] int  IDENTITY(1,1) NOT NULL,
  [Config] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [DBServer] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NULL,
  [DbSql] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NULL,
  [DicName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DicNo] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Enable] tinyint  NOT NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [OrderNo] int  NULL,
  [ParentId] int  NOT NULL,
  [Remark] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Sys_Dictionary] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_DictionaryList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_DictionaryList]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_DictionaryList]
GO

CREATE TABLE [dbo].[Sys_DictionaryList] (
  [DicList_ID] int  IDENTITY(1,1) NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [DicName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [DicValue] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Dic_ID] int  NULL,
  [Enable] tinyint  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [OrderNo] int  NULL,
  [Remark] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Sys_DictionaryList] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_Log
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Log]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_Log]
GO

CREATE TABLE [dbo].[Sys_Log] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [BeginDate] datetime  NULL,
  [BrowserType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ElapsedTime] int  NULL,
  [EndDate] datetime  NULL,
  [ExceptionInfo] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [LogType] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [RequestParameter] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [ResponseParameter] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [Role_Id] int  NULL,
  [ServiceIP] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Success] int  NULL,
  [Url] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NULL,
  [UserIP] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [UserName] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NULL,
  [User_Id] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_Log] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_Menu
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Menu]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_Menu]
GO

CREATE TABLE [dbo].[Sys_Menu] (
  [Menu_Id] int  IDENTITY(1,1) NOT NULL,
  [MenuName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Auth] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NULL,
  [Icon] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Description] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] tinyint  NULL,
  [OrderNo] int  NULL,
  [TableName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ParentId] int  NOT NULL,
  [Url] nvarchar(4000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [Creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [Modifier] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [MenuType] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_Menu] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_Province
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Province]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_Province]
GO

CREATE TABLE [dbo].[Sys_Province] (
  [ProvinceId] int  IDENTITY(1,1) NOT NULL,
  [ProvinceCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProvinceName] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [RegionCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Sys_Province] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_QuartzLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_QuartzLog]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_QuartzLog]
GO

CREATE TABLE [dbo].[Sys_QuartzLog] (
  [LogId] uniqueidentifier  NOT NULL,
  [Id] uniqueidentifier  NULL,
  [TaskName] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [ElapsedTime] int  NULL,
  [StratDate] datetime  NULL,
  [EndDate] datetime  NULL,
  [Result] int  NULL,
  [ResponseContent] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [ErrorMsg] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Sys_QuartzLog] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_QuartzOptions
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_QuartzOptions]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_QuartzOptions]
GO

CREATE TABLE [dbo].[Sys_QuartzOptions] (
  [Id] uniqueidentifier  NOT NULL,
  [TaskName] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [GroupName] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CronExpression] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Method] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ApiUrl] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
  [AuthKey] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [AuthValue] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Describe] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
  [LastRunTime] datetime  NULL,
  [Status] int  NULL,
  [PostData] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [TimeOut] int  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Sys_QuartzOptions] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_Role
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Role]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_Role]
GO

CREATE TABLE [dbo].[Sys_Role] (
  [Role_Id] int  IDENTITY(1,1) NOT NULL,
  [CreateDate] datetime  NULL,
  [Creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DeleteBy] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DeptName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Dept_Id] int  NULL,
  [Enable] tinyint  NULL,
  [Modifier] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [OrderNo] int  NULL,
  [ParentId] int  NOT NULL,
  [RoleName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Sys_Role] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_RoleAuth
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_RoleAuth]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_RoleAuth]
GO

CREATE TABLE [dbo].[Sys_RoleAuth] (
  [Auth_Id] int  IDENTITY(1,1) NOT NULL,
  [AuthValue] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [Creator] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [Menu_Id] int  NOT NULL,
  [Modifier] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [Role_Id] int  NULL,
  [User_Id] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_RoleAuth] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_TableColumn
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_TableColumn]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_TableColumn]
GO

CREATE TABLE [dbo].[Sys_TableColumn] (
  [ColumnId] int  IDENTITY(1,1) NOT NULL,
  [ApiInPut] int  NULL,
  [ApiIsNull] int  NULL,
  [ApiOutPut] int  NULL,
  [ColSize] int  NULL,
  [ColumnCNName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ColumnName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ColumnType] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [ColumnWidth] int  NULL,
  [Columnformat] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [DropNo] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [EditColNo] int  NULL,
  [EditRowNo] int  NULL,
  [EditType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] int  NULL,
  [IsColumnData] int  NULL,
  [IsDisplay] int  NULL,
  [IsImage] int  NULL,
  [IsKey] int  NULL,
  [IsNull] int  NULL,
  [IsReadDataset] int  NULL,
  [Maxlength] int  NULL,
  [Modifier] ntext COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [OrderNo] int  NULL,
  [Script] ntext COLLATE Chinese_PRC_CI_AS  NULL,
  [SearchColNo] int  NULL,
  [SearchRowNo] int  NULL,
  [SearchType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Sortable] int  NULL,
  [TableName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Table_Id] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_TableColumn] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_TableInfo
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_TableInfo]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_TableInfo]
GO

CREATE TABLE [dbo].[Sys_TableInfo] (
  [Table_Id] int  IDENTITY(1,1) NOT NULL,
  [CnName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ColumnCNName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [DBServer] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL,
  [DataTableType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [DetailCnName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [DetailName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [EditorType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] int  NULL,
  [ExpressField] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [FolderName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Namespace] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [OrderNo] int  NULL,
  [ParentId] int  NULL,
  [RichText] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [SortName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TableName] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TableTrueName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [UploadField] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [UploadMaxCount] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_TableInfo] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_Unit
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_Unit]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_Unit]
GO

CREATE TABLE [dbo].[Sys_Unit] (
  [Unit_Id] int  IDENTITY(1,1) NOT NULL,
  [UnitName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_Unit] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'单位表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'UnitName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Sys_Unit',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Sys_User
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_User]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_User]
GO

CREATE TABLE [dbo].[Sys_User] (
  [User_Id] int  IDENTITY(1,1) NOT NULL,
  [Address] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [AppType] int  NULL,
  [AuditDate] datetime  NULL,
  [AuditStatus] int  NULL,
  [Auditor] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [DeptName] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NULL,
  [Dept_Id] int  NULL,
  [Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] tinyint  NOT NULL,
  [Gender] int  NULL,
  [HeadImageUrl] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsRegregisterPhone] int  NOT NULL,
  [LastLoginDate] datetime  NULL,
  [LastModifyPwdDate] datetime  NULL,
  [Mobile] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [OrderNo] int  NULL,
  [Role_Id] int  NOT NULL,
  [RoleName] nvarchar(150) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [PhoneNo] nvarchar(11) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Tel] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [UserName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [UserPwd] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [UserTrueName] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Token] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Sys_User] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for Sys_VersionInfo
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_VersionInfo]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_VersionInfo]
GO

CREATE TABLE [dbo].[Sys_VersionInfo] (
  [VersionInfo_Id] int  IDENTITY(1,1) NOT NULL,
  [Title] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Url] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_VersionInfo] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'版本更新表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'VersionInfo_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标题',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'Title'
GO

EXEC sp_addextendedproperty
'MS_Description', N'链接网址',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'Url'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Sys_VersionInfo',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Sys_WorkFlow
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_WorkFlow]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_WorkFlow]
GO

CREATE TABLE [dbo].[Sys_WorkFlow] (
  [WorkFlow_Id] uniqueidentifier  NOT NULL,
  [WorkName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WorkTable] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WorkTableName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [NodeConfig] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineConfig] nvarchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] tinyint  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_WorkFlow] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程名称',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlow',
'COLUMN', N'WorkName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'表名',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlow',
'COLUMN', N'WorkTable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'功能菜单',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlow',
'COLUMN', N'WorkTableName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'节点信息',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlow',
'COLUMN', N'NodeConfig'
GO

EXEC sp_addextendedproperty
'MS_Description', N'连接配置',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlow',
'COLUMN', N'LineConfig'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlow',
'COLUMN', N'Remark'
GO


-- ----------------------------
-- Table structure for Sys_WorkFlowStep
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_WorkFlowStep]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_WorkFlowStep]
GO

CREATE TABLE [dbo].[Sys_WorkFlowStep] (
  [WorkStepFlow_Id] uniqueidentifier  NOT NULL,
  [WorkFlow_Id] uniqueidentifier  NULL,
  [StepId] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [StepName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [StepType] int  NULL,
  [StepValue] int  NULL,
  [OrderId] int  NULL,
  [Remark] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] tinyint  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_WorkFlowStep] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程主表id',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowStep',
'COLUMN', N'WorkFlow_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程节点Id',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowStep',
'COLUMN', N'StepId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'节点名称',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowStep',
'COLUMN', N'StepName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'节点类型(1=按用户审批,2=按角色审批)',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowStep',
'COLUMN', N'StepType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'审批用户id或角色id',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowStep',
'COLUMN', N'StepValue'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowStep',
'COLUMN', N'Remark'
GO


-- ----------------------------
-- Table structure for Sys_WorkFlowTable
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_WorkFlowTable]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_WorkFlowTable]
GO

CREATE TABLE [dbo].[Sys_WorkFlowTable] (
  [WorkFlowTable_Id] uniqueidentifier  NOT NULL,
  [WorkFlow_Id] uniqueidentifier  NULL,
  [WorkName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkTableKey] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkTable] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [WorkTableName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [CurrentOrderId] int  NULL,
  [AuditStatus] int  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] tinyint  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_WorkFlowTable] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'表主键id',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowTable',
'COLUMN', N'WorkTableKey'
GO

EXEC sp_addextendedproperty
'MS_Description', N'表名',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowTable',
'COLUMN', N'WorkTable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'表中文名',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowTable',
'COLUMN', N'WorkTableName'
GO


-- ----------------------------
-- Table structure for Sys_WorkFlowTableStep
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Sys_WorkFlowTableStep]') AND type IN ('U'))
	DROP TABLE [dbo].[Sys_WorkFlowTableStep]
GO

CREATE TABLE [dbo].[Sys_WorkFlowTableStep] (
  [Sys_WorkFlowTableStep_Id] uniqueidentifier  NOT NULL,
  [WorkFlowTable_Id] uniqueidentifier  NOT NULL,
  [WorkFlow_Id] uniqueidentifier  NULL,
  [StepId] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [StepName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [StepType] int  NULL,
  [StepValue] int  NULL,
  [OrderId] int  NULL,
  [AuditId] int  NULL,
  [Auditor] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [AuditStatus] int  NULL,
  [AuditDate] datetime  NULL,
  [Remark] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [Enable] tinyint  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Sys_WorkFlowTableStep] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'审核人id',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowTableStep',
'COLUMN', N'AuditId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'审核人',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowTableStep',
'COLUMN', N'Auditor'
GO

EXEC sp_addextendedproperty
'MS_Description', N'审核状态',
'SCHEMA', N'dbo',
'TABLE', N'Sys_WorkFlowTableStep',
'COLUMN', N'AuditStatus'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Ald
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Ald]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Ald]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Ald] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Formula] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatChannel] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractQty] int  NULL,
  [ExtractStatus] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FallQty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Ald] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺配方',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'Formula'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'BoatChannel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检花篮',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'ExtractUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已抽检数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'ExtractQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'ExtractStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'掉片数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'FallQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'ALD数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Ald'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Bdm
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Bdm]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Bdm]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Bdm] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TYPE] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [Flag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Formula] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatChannel] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FallQty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Bdm] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'TYPE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'Flag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺配方',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'Formula'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'BoatChannel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'掉片数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'FallQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'背镀膜数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bdm'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Bsg
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Bsg]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Bsg]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Bsg] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TYPE] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [EId] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [PId] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [STartFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [EndFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Sequence] int  NULL,
  [TongueFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [BufferFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChangeFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [ChannelNo] int  NULL,
  [SORT] int  NULL,
  [CreatedTime] datetime  NULL,
  [OppositeSequence] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTimeStamp] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Bsg] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分类',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'TYPE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'EId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'PId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'STartFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'EndFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'顺序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'Sequence'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舌头信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'TongueFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'BUFFER上长下降信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'BufferFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'变道信息',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'ChangeFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'序号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'SORT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'BSG数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Bsg'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_BsgJP
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_BsgJP]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_BsgJP]
GO

CREATE TABLE [dbo].[Tbl_DataClear_BsgJP] (
  [Id] decimal(38,30)  NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] decimal(38,30)  NULL,
  [UpDown] decimal(38,30)  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_BsgJP] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'BSG碱抛数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_BsgJP'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Lks
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Lks]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Lks]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Lks] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Formula] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatChannel] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractQty] int  NULL,
  [ExtractStatus] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FallQty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Lks] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺配方',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'Formula'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'BoatChannel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检花篮',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'ExtractUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已抽检数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'ExtractQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'ExtractStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'掉片数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'FallQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'磷扩数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lks'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Lpcvd
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Lpcvd]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Lpcvd]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Lpcvd] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Formula] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatChannel] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractQty] int  NULL,
  [ExtractStatus] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FallQty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Lpcvd] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺配方',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'Formula'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'BoatChannel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检花篮',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'ExtractUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已抽检数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'ExtractQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'ExtractStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'掉片数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'FallQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'LPCVD数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Lpcvd'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Pks
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Pks]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Pks]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Pks] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] decimal(38,30)  NULL,
  [UpDown] decimal(38,30)  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Formula] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatChannel] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractQty] decimal(38,30)  NULL,
  [ExtractStatus] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FallQty] decimal(38,30)  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Pks] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺配方',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'Formula'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'BoatChannel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检花篮',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'ExtractUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已抽检数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'ExtractQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'ExtractStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'掉片数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'FallQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'硼扩数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Pks'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Poly
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Poly]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Poly]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Poly] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Formula] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatChannel] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ExtractQty] int  NULL,
  [ExtractStatus] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FallQty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Poly] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺配方',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'Formula'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'BoatChannel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检花篮',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'ExtractUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'已抽检数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'ExtractQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'抽检状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'ExtractStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'掉片数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'FallQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'POLY数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Poly'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Psg
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Psg]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Psg]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Psg] (
  [Id] decimal(38,30)  NULL,
  [TYPE] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [EId] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [PId] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [STartFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [EndFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Sequence] decimal(38,30)  NULL,
  [TongueFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [BufferFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChangeFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] decimal(38,30)  NULL,
  [ChannelNo] decimal(38,30)  NULL,
  [SORT] decimal(38,30)  NULL,
  [CreatedTime] datetime  NULL,
  [OppositeSequence] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTimeStamp] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Psg] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分类',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'TYPE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'EId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'PId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'STartFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'EndFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'顺序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'Sequence'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舌头信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'TongueFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'BUFFER上长下降信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'BufferFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'变道信息',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'ChangeFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'序号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'SORT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'PSG数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psg'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Psgjp
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Psgjp]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Psgjp]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Psgjp] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Psgjp] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'PSG碱抛数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Psgjp'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Se
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Se]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Se]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Se] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TYPE] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [EId] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [PId] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [STartFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [EndFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Sequence] int  NULL,
  [TongueFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [BufferFlag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [ChannelNo] int  NULL,
  [SORT] int  NULL,
  [CreatedTime] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OppositeSequence] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTimeStamp] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Se] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分类',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'TYPE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'EId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'PId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'开始信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'STartFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'结束信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'EndFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'顺序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'Sequence'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舌头信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'TongueFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'BUFFER上长下降信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'BufferFlag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料信号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'序号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'SORT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'SE数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Se'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swhc1
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swhc1]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swhc1]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swhc1] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swhc1] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网1道缓存数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc1'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swhc2
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swhc2]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swhc2]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swhc2] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swhc2] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网2道缓存数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc2'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swhc3
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swhc3]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swhc3]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swhc3] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swhc3] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网3道缓存数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhc3'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swhx1
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swhx1]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swhx1]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swhx1] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swhx1] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网1道烘箱数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx1'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swhx2
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swhx2]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swhx2]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swhx2] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swhx2] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网2道烘箱数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx2'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swhx3
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swhx3]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swhx3]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swhx3] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swhx3] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网3道烘箱数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swhx3'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swsj
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swsj]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swsj]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swsj] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swsj] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'烧结炉数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swsj'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swys1
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swys1]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swys1]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swys1] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swys1] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网1道印刷数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys1'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swys2
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swys2]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swys2]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swys2] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swys2] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网2道印刷数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys2'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swys3
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swys3]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swys3]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swys3] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swys3] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网3道印刷数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys3'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Swys4
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Swys4]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Swys4]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Swys4] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [LineSide] varchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] int  NULL,
  [Qty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Swys4] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'侧别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'LineSide'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'丝网4道印刷数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Swys4'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Zdm
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Zdm]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Zdm]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Zdm] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TYPE] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [Flag] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Formula] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatChannel] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FallQty] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Zdm] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'TYPE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'ChannelNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'Flag'
GO

EXEC sp_addextendedproperty
'MS_Description', N'实时数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工艺配方',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'Formula'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟通道',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'BoatChannel'
GO

EXEC sp_addextendedproperty
'MS_Description', N'掉片数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'FallQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数据时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'DataTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'正镀膜数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zdm'
GO


-- ----------------------------
-- Table structure for Tbl_DataClear_Zr
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_DataClear_Zr]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_DataClear_Zr]
GO

CREATE TABLE [dbo].[Tbl_DataClear_Zr] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ChannelNo] int  NULL,
  [UpDown] int  NULL,
  [DataTime] datetime  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_DataClear_Zr] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'制绒数据清洗',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_DataClear_Zr'
GO


-- ----------------------------
-- Table structure for Tbl_Package_Box
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Package_Box]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Package_Box]
GO

CREATE TABLE [dbo].[Tbl_Package_Box] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FormulaName] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Bin] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Printer] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoxNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CartonNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Package] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Shift] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [IsRework] char(1) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReworkNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsClosed] char(1) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Package_Box] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分档方案',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'FormulaName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Bin盒号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Bin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'RFId号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'打印机',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Printer'
GO

EXEC sp_addextendedproperty
'MS_Description', N'小盒条码',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'BoxNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外箱条码',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'CartonNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'包装模板',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Package'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Shift'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否重工',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'IsRework'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'ReworkNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否关闭',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box',
'COLUMN', N'IsClosed'
GO

EXEC sp_addextendedproperty
'MS_Description', N'小盒信息',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Box'
GO


-- ----------------------------
-- Table structure for Tbl_Package_Carton
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Package_Carton]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Package_Carton]
GO

CREATE TABLE [dbo].[Tbl_Package_Carton] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FormulaName] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Bin] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Printer] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CartonNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Package] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Shift] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [IsRework] char(1) COLLATE Chinese_PRC_CI_AS  NULL,
  [ReworkNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] varchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsClosed] char(1) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Package_Carton] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分档方案',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'FormulaName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Bin盒号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Bin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'RFId号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'打印机',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Printer'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外箱条码',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'CartonNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'包装模板',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Package'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'班别',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Shift'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否重工',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'IsRework'
GO

EXEC sp_addextendedproperty
'MS_Description', N'重工单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'ReworkNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否关闭',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton',
'COLUMN', N'IsClosed'
GO

EXEC sp_addextendedproperty
'MS_Description', N'外箱信息',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Carton'
GO


-- ----------------------------
-- Table structure for Tbl_Package_Template
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Package_Template]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Package_Template]
GO

CREATE TABLE [dbo].[Tbl_Package_Template] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [FormulaName] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [PackageNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TemplateName] varchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [SerialNo] int  NULL,
  [SerialCode] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SerialData] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DataJson] varchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [PackageType] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsEnable] char(1) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Package_Template] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'分档文件名',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'FormulaName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'包装规则名',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'PackageNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标签模板',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'TemplateName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前流水号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'SerialNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'条码规格',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'SerialCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'条码数据',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'SerialData'
GO

EXEC sp_addextendedproperty
'MS_Description', N'条码数据',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'DataJson'
GO

EXEC sp_addextendedproperty
'MS_Description', N'包装类型（BOX/Carton）',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'PackageType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'条码模板',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Package_Template'
GO


-- ----------------------------
-- Table structure for Tbl_Trace_BoxWafer
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Trace_BoxWafer]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Trace_BoxWafer]
GO

CREATE TABLE [dbo].[Tbl_Trace_BoxWafer] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WaferId] int  NULL,
  [Bin] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Printer] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoxNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Status] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [UpdatedTime] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Trace_BoxWafer] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'WaferId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'WaferId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Bin盒号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'Bin'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标签打印机',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'Printer'
GO

EXEC sp_addextendedproperty
'MS_Description', N'小盒条码',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'BoxNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Bin盒状态   0：生产中；1：下料；2：已打标签；3：入PC库；',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer',
'COLUMN', N'UpdatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'小盒内Wafer',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_BoxWafer'
GO


-- ----------------------------
-- Table structure for Tbl_Trace_FlowCard
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Trace_FlowCard]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Trace_FlowCard]
GO

CREATE TABLE [dbo].[Tbl_Trace_FlowCard] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TenantId] int  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FlowNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [CreatedTime] datetime  NULL,
  [CurrentEquipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CurrentProcess] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CurrentTime] datetime  NULL,
  [UpDown] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsOut] char(1) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Craft] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ScrapQty] int  NULL,
  [QuarantineQty] int  NULL,
  [Status] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Trace_FlowCard] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程卡号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'FlowNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'CurrentEquipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'CurrentProcess'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前工作时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'CurrentTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是不产出',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'IsOut'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'糟号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产工艺',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Craft'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'ScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'QuarantineQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程卡信息表',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowCard'
GO


-- ----------------------------
-- Table structure for Tbl_Trace_FlowMaterial
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Trace_FlowMaterial]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Trace_FlowMaterial]
GO

CREATE TABLE [dbo].[Tbl_Trace_FlowMaterial] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [FlowNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [CreatedUser] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreatedTime] datetime  NULL,
  [IsEnable] char(1) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Trace_FlowMaterial] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'过站流程Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'FlowNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'CreatedUser'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial',
'COLUMN', N'IsEnable'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程卡物料信息',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowMaterial'
GO


-- ----------------------------
-- Table structure for Tbl_Trace_FlowTrace
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Trace_FlowTrace]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Trace_FlowTrace]
GO

CREATE TABLE [dbo].[Tbl_Trace_FlowTrace] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TenantId] int  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FlowNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InLine] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InEquipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InProcess] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InTime] datetime  NULL,
  [InStruid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutLine] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutEquipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutProcess] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutTime] datetime  NULL,
  [OutStruid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Craft] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsOut] char(1) COLLATE Chinese_PRC_CI_AS  NULL,
  [ScrapQty] int  NULL,
  [QuarantineQty] int  NULL,
  [Status] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Trace_FlowTrace] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程卡号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'FlowNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'InLine'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'InEquipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'InProcess'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'InTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'InStruid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'OutLine'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'OutEquipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'OutProcess'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'OutTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'OutStruid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产工艺',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'Craft'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是不产出',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'IsOut'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'ScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'QuarantineQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程卡详情',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_FlowTrace'
GO


-- ----------------------------
-- Table structure for Tbl_Trace_Wafer
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Trace_Wafer]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Trace_Wafer]
GO

CREATE TABLE [dbo].[Tbl_Trace_Wafer] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TenantId] int  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FlowNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Line] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Equipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Process] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [StrUid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [CreatedTime] datetime  NULL,
  [CurrentEquipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CurrentProcess] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CurrentTime] datetime  NULL,
  [UpDown] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsOut] char(1) COLLATE Chinese_PRC_CI_AS  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Craft] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Material] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ScrapQty] int  NULL,
  [QuarantineQty] int  NULL,
  [Status] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Trace_Wafer] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程卡号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'FlowNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Line'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Equipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Process'
GO

EXEC sp_addextendedproperty
'MS_Description', N'花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'StrUid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'CreatedTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'CurrentEquipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'CurrentProcess'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前工作时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'CurrentTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是不产出',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'IsOut'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'糟号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产工艺',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Craft'
GO

EXEC sp_addextendedproperty
'MS_Description', N'物料单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Material'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'ScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'QuarantineQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Wafer数据',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_Wafer'
GO


-- ----------------------------
-- Table structure for Tbl_Trace_WaferTrace
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tbl_Trace_WaferTrace]') AND type IN ('U'))
	DROP TABLE [dbo].[Tbl_Trace_WaferTrace]
GO

CREATE TABLE [dbo].[Tbl_Trace_WaferTrace] (
  [Id] int  IDENTITY(1,1) NOT NULL,
  [TenantId] int  NULL,
  [WorkOrder] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FlowNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [WaferId] int  NULL,
  [InLine] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InEquipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InProcess] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [InTime] datetime  NULL,
  [InStruid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutLine] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutEquipment] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutProcess] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [OutTime] datetime  NULL,
  [OutStruid] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NULL,
  [BoatNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [GrooveNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [TubeNo] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [Craft] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [UpDown] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [IsOut] char(1) COLLATE Chinese_PRC_CI_AS  NULL,
  [ScrapQty] int  NULL,
  [QuarantineQty] int  NULL,
  [Status] char(10) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Tbl_Trace_WaferTrace] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'客户Id',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'TenantId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工单号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'WorkOrder'
GO

EXEC sp_addextendedproperty
'MS_Description', N'流程卡号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'FlowNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'WaferId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'WaferId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'InLine'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'InEquipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'InProcess'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'InTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'投入花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'InStruid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出产线',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'OutLine'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出设备',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'OutEquipment'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出工序',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'OutProcess'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出时间',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'OutTime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产出花篮UId',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'OutStruid'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'舟号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'BoatNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'槽号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'GrooveNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'管号',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'TubeNo'
GO

EXEC sp_addextendedproperty
'MS_Description', N'生产工艺',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'Craft'
GO

EXEC sp_addextendedproperty
'MS_Description', N'上/下料',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'UpDown'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是不产出',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'IsOut'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报废数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'ScrapQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'隔离数量',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'QuarantineQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Wafer数据',
'SCHEMA', N'dbo',
'TABLE', N'Tbl_Trace_WaferTrace'
GO


-- ----------------------------
-- Table structure for Tools_Tool
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tools_Tool]') AND type IN ('U'))
	DROP TABLE [dbo].[Tools_Tool]
GO

CREATE TABLE [dbo].[Tools_Tool] (
  [ToolId] uniqueidentifier  NOT NULL,
  [ToolName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ToolCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Brand] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Spec] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [ToolTypeId] uniqueidentifier  NULL,
  [Quantity] int  NOT NULL,
  [QuantityAvail] int  NULL,
  [MaintenType] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [NextMaintenDate] date  NULL,
  [Status] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tools_Tool] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'ToolId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具名称',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'ToolName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具编码',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'ToolCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'品牌',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'Brand'
GO

EXEC sp_addextendedproperty
'MS_Description', N'型号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'Spec'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具类型',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'ToolTypeId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'Quantity'
GO

EXEC sp_addextendedproperty
'MS_Description', N'可用数量',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'QuantityAvail'
GO

EXEC sp_addextendedproperty
'MS_Description', N'保养维护方式',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'MaintenType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'下次保养日期',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'NextMaintenDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'Status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_Tool',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Tools_ToolsReceive
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tools_ToolsReceive]') AND type IN ('U'))
	DROP TABLE [dbo].[Tools_ToolsReceive]
GO

CREATE TABLE [dbo].[Tools_ToolsReceive] (
  [ToolsReceiveId] int  IDENTITY(1,1) NOT NULL,
  [ToolsReceiveCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [ReceiveDate] date  NULL
)
GO

ALTER TABLE [dbo].[Tools_ToolsReceive] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'领用主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'ToolsReceiveId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'领用编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'ToolsReceiveCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'领用日期',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceive',
'COLUMN', N'ReceiveDate'
GO


-- ----------------------------
-- Table structure for Tools_ToolsReceiveList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tools_ToolsReceiveList]') AND type IN ('U'))
	DROP TABLE [dbo].[Tools_ToolsReceiveList]
GO

CREATE TABLE [dbo].[Tools_ToolsReceiveList] (
  [ToolsReceiveListId] int  IDENTITY(1,1) NOT NULL,
  [ToolsReceiveId] int  NOT NULL,
  [ToolId] uniqueidentifier  NOT NULL,
  [ToolName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ToolCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Brand] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Spec] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Tools_ToolsReceiveList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'刀具领用明细主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'ToolsReceiveListId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'刀具领用主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'ToolsReceiveId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'ToolId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具名称',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'ToolName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'ToolCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'品牌',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'Brand'
GO

EXEC sp_addextendedproperty
'MS_Description', N'型号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'Spec'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReceiveList',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Tools_ToolsReturn
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tools_ToolsReturn]') AND type IN ('U'))
	DROP TABLE [dbo].[Tools_ToolsReturn]
GO

CREATE TABLE [dbo].[Tools_ToolsReturn] (
  [ToolsReturnId] int  IDENTITY(1,1) NOT NULL,
  [ToolsReturnCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ToolsReturnDate] date  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Tools_ToolsReturn] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'归还主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'ToolsReturnId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'归还编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'ToolsReturnCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'归还日期',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'ToolsReturnDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturn',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Tools_ToolsReturnList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tools_ToolsReturnList]') AND type IN ('U'))
	DROP TABLE [dbo].[Tools_ToolsReturnList]
GO

CREATE TABLE [dbo].[Tools_ToolsReturnList] (
  [ToolsReturnListId] int  IDENTITY(1,1) NOT NULL,
  [ToolsReturnId] int  NOT NULL,
  [ToolId] uniqueidentifier  NOT NULL,
  [ToolName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ToolCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Brand] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Spec] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [Qty] int  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Tools_ToolsReturnList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'刀具归还明细主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'ToolsReturnListId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'刀具归还主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'ToolsReturnId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'ToolId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具名称',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'ToolName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工装夹具编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'ToolCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'品牌',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'Brand'
GO

EXEC sp_addextendedproperty
'MS_Description', N'型号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'Spec'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'Qty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolsReturnList',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Tools_ToolType
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Tools_ToolType]') AND type IN ('U'))
	DROP TABLE [dbo].[Tools_ToolType]
GO

CREATE TABLE [dbo].[Tools_ToolType] (
  [ToolTypeId] uniqueidentifier  NOT NULL,
  [ToolTypeName] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ToolTypeCode] varchar(100) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [MaintenType] nvarchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [MaintenPeriod] int  NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Modifier] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL
)
GO

ALTER TABLE [dbo].[Tools_ToolType] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'工具类型主键',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'ToolTypeId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工具类型名称',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'ToolTypeName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'工具类型编码',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'ToolTypeCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'保养维护方式',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'MaintenType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'保养周期',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'MaintenPeriod'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Tools_ToolType',
'COLUMN', N'ModifyDate'
GO


-- ----------------------------
-- Table structure for Ware_OutWareHouseBill
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Ware_OutWareHouseBill]') AND type IN ('U'))
	DROP TABLE [dbo].[Ware_OutWareHouseBill]
GO

CREATE TABLE [dbo].[Ware_OutWareHouseBill] (
  [OutWareHouseBill_Id] int  IDENTITY(1,1) NOT NULL,
  [OutWareHouseBillCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [OutWareHouseBillType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [OutWareHouseDate] datetime  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [AuditStatus] int  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [ImageUrl] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Attachement] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[Ware_OutWareHouseBill] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库单主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'OutWareHouseBill_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库单号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'OutWareHouseBillCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库类型',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'OutWareHouseBillType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'OutWareHouseDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'审批状态',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'AuditStatus'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBill',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Ware_OutWareHouseBillList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Ware_OutWareHouseBillList]') AND type IN ('U'))
	DROP TABLE [dbo].[Ware_OutWareHouseBillList]
GO

CREATE TABLE [dbo].[Ware_OutWareHouseBillList] (
  [OutWareHouseBillList_Id] int  IDENTITY(1,1) NOT NULL,
  [OutWareHouseBill_Id] int  NOT NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Unit_Id] int  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [MaxInventory] int  NULL,
  [MinInventory] int  NULL,
  [SafeInventory] int  NULL,
  [InventoryQty] int  NULL,
  [OutStoreQty] int  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Product_Id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[Ware_OutWareHouseBillList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库单产品明细表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'OutWareHouseBillList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库单',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'OutWareHouseBill_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'库存单位',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最大库存',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'MaxInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最小库存',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'MinInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'安全库存',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'SafeInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前库存数量',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'InventoryQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'出库数量',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'OutStoreQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品ID',
'SCHEMA', N'dbo',
'TABLE', N'Ware_OutWareHouseBillList',
'COLUMN', N'Product_Id'
GO


-- ----------------------------
-- Table structure for Ware_WareHouseBill
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Ware_WareHouseBill]') AND type IN ('U'))
	DROP TABLE [dbo].[Ware_WareHouseBill]
GO

CREATE TABLE [dbo].[Ware_WareHouseBill] (
  [WareHouseBill_Id] int  IDENTITY(1,1) NOT NULL,
  [WareHouseBillCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WareHouseBillType] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [WareHouseDate] datetime  NOT NULL,
  [Remark] nvarchar(1000) COLLATE Chinese_PRC_CI_AS  NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL
)
GO

ALTER TABLE [dbo].[Ware_WareHouseBill] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库单主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'WareHouseBill_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库单号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'WareHouseBillCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库类型',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'WareHouseBillType'
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'WareHouseDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'Remark'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBill',
'COLUMN', N'ModifyID'
GO


-- ----------------------------
-- Table structure for Ware_WareHouseBillList
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Ware_WareHouseBillList]') AND type IN ('U'))
	DROP TABLE [dbo].[Ware_WareHouseBillList]
GO

CREATE TABLE [dbo].[Ware_WareHouseBillList] (
  [WareHouseBillList_Id] int  IDENTITY(1,1) NOT NULL,
  [WareHouseBill_Id] int  NOT NULL,
  [ProductCode] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [ProductName] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [Unit_Id] int  NOT NULL,
  [ProductStandard] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [MaxInventory] int  NULL,
  [MinInventory] int  NULL,
  [SafeInventory] int  NULL,
  [InventoryQty] int  NULL,
  [InStoreQty] int  NOT NULL,
  [CreateDate] datetime  NULL,
  [CreateID] int  NULL,
  [Creator] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [Modifier] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [ModifyDate] datetime  NULL,
  [ModifyID] int  NULL,
  [Product_Id] int  NOT NULL
)
GO

ALTER TABLE [dbo].[Ware_WareHouseBillList] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库单产品明细表主键ID',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'WareHouseBillList_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库单',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'WareHouseBill_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'ProductCode'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品名称',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'ProductName'
GO

EXEC sp_addextendedproperty
'MS_Description', N'库存单位',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'Unit_Id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品规格',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'ProductStandard'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最大库存',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'MaxInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'最小库存',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'MinInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'安全库存',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'SafeInventory'
GO

EXEC sp_addextendedproperty
'MS_Description', N'当前库存数量',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'InventoryQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'入库数量',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'InStoreQty'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'CreateDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'CreateID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'Creator'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'Modifier'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'ModifyDate'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人编号',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'ModifyID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'产品ID',
'SCHEMA', N'dbo',
'TABLE', N'Ware_WareHouseBillList',
'COLUMN', N'Product_Id'
GO


-- ----------------------------
-- Auto increment value for Base_DefectItem
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_DefectItem]', RESEED, 46)
GO


-- ----------------------------
-- Primary Key structure for table Base_DefectItem
-- ----------------------------
ALTER TABLE [dbo].[Base_DefectItem] ADD CONSTRAINT [PK_Base_DefectItem] PRIMARY KEY CLUSTERED ([DefectItem_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_DesktopMenu
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_DesktopMenu]', RESEED, 3)
GO


-- ----------------------------
-- Primary Key structure for table Base_DesktopMenu
-- ----------------------------
ALTER TABLE [dbo].[Base_DesktopMenu] ADD CONSTRAINT [PK_Base_DesktopMenu] PRIMARY KEY CLUSTERED ([DesktopMenu_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_MaterialDetail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_MaterialDetail]', RESEED, 30)
GO


-- ----------------------------
-- Primary Key structure for table Base_MaterialDetail
-- ----------------------------
ALTER TABLE [dbo].[Base_MaterialDetail] ADD CONSTRAINT [PK_Base_MaterialDetail] PRIMARY KEY CLUSTERED ([MaterialDetail_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_MeritPay
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_MeritPay]', RESEED, 5)
GO


-- ----------------------------
-- Primary Key structure for table Base_MeritPay
-- ----------------------------
ALTER TABLE [dbo].[Base_MeritPay] ADD CONSTRAINT [PK_Base_MeritPay] PRIMARY KEY CLUSTERED ([MeritPay_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_Notice
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_Notice]', RESEED, 20)
GO


-- ----------------------------
-- Primary Key structure for table Base_Notice
-- ----------------------------
ALTER TABLE [dbo].[Base_Notice] ADD CONSTRAINT [PK_Base_Notice] PRIMARY KEY CLUSTERED ([Notice_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_NumberRule
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_NumberRule]', RESEED, 28)
GO


-- ----------------------------
-- Primary Key structure for table Base_NumberRule
-- ----------------------------
ALTER TABLE [dbo].[Base_NumberRule] ADD CONSTRAINT [PK_Base_NumberRule] PRIMARY KEY CLUSTERED ([NumberRule_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_Process
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_Process]', RESEED, 42)
GO


-- ----------------------------
-- Primary Key structure for table Base_Process
-- ----------------------------
ALTER TABLE [dbo].[Base_Process] ADD CONSTRAINT [PK_Base_Process] PRIMARY KEY CLUSTERED ([Process_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_ProcessLine
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_ProcessLine]', RESEED, 32)
GO


-- ----------------------------
-- Primary Key structure for table Base_ProcessLine
-- ----------------------------
ALTER TABLE [dbo].[Base_ProcessLine] ADD CONSTRAINT [PK_Base_ProcessLine] PRIMARY KEY CLUSTERED ([ProcessLine_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_ProcessLineList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_ProcessLineList]', RESEED, 132)
GO


-- ----------------------------
-- Primary Key structure for table Base_ProcessLineList
-- ----------------------------
ALTER TABLE [dbo].[Base_ProcessLineList] ADD CONSTRAINT [PK_Base_ProcessLineList] PRIMARY KEY CLUSTERED ([ProcessLineList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_ProcessList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_ProcessList]', RESEED, 7)
GO


-- ----------------------------
-- Primary Key structure for table Base_ProcessList
-- ----------------------------
ALTER TABLE [dbo].[Base_ProcessList] ADD CONSTRAINT [PK_Base_ProcessList] PRIMARY KEY CLUSTERED ([ProcessList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Base_Product
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Base_Product]', RESEED, 39)
GO


-- ----------------------------
-- Primary Key structure for table Base_Product
-- ----------------------------
ALTER TABLE [dbo].[Base_Product] ADD CONSTRAINT [PK_Base_Product] PRIMARY KEY CLUSTERED ([Product_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Base_WorkShop
-- ----------------------------
ALTER TABLE [dbo].[Base_WorkShop] ADD CONSTRAINT [PK_Base_WorkShop] PRIMARY KEY CLUSTERED ([WorkShopId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Cal_Holiday
-- ----------------------------
ALTER TABLE [dbo].[Cal_Holiday] ADD CONSTRAINT [PK_Cal_Holiday] PRIMARY KEY CLUSTERED ([HolidayId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Cal_Plan
-- ----------------------------
ALTER TABLE [dbo].[Cal_Plan] ADD CONSTRAINT [PK_Cal_Plan] PRIMARY KEY CLUSTERED ([PlanId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Cal_PlanShift
-- ----------------------------
ALTER TABLE [dbo].[Cal_PlanShift] ADD CONSTRAINT [PK_Cal_Shift] PRIMARY KEY CLUSTERED ([PlanShiftId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Cal_PlanTeam
-- ----------------------------
ALTER TABLE [dbo].[Cal_PlanTeam] ADD CONSTRAINT [PK_Cal_PlanTeam] PRIMARY KEY CLUSTERED ([PlanTeamId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Cal_Team
-- ----------------------------
ALTER TABLE [dbo].[Cal_Team] ADD CONSTRAINT [PK_Cal_Team] PRIMARY KEY CLUSTERED ([TeamId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Cal_TeamMember
-- ----------------------------
ALTER TABLE [dbo].[Cal_TeamMember] ADD CONSTRAINT [PK_Cal_TeamMember] PRIMARY KEY CLUSTERED ([TeamMemberId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Cal_TeamShift
-- ----------------------------
ALTER TABLE [dbo].[Cal_TeamShift] ADD CONSTRAINT [PK_Cal_TeamShift] PRIMARY KEY CLUSTERED ([TeamShiftId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_DevCatalog
-- ----------------------------
ALTER TABLE [dbo].[Equip_DevCatalog] ADD CONSTRAINT [PK_Equip_DevCatalog] PRIMARY KEY CLUSTERED ([DevCatalogId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_Device
-- ----------------------------
ALTER TABLE [dbo].[Equip_Device] ADD CONSTRAINT [PK_Equip_Device] PRIMARY KEY CLUSTERED ([DeviceId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Equip_Fault
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Equip_Fault]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Equip_Fault
-- ----------------------------
ALTER TABLE [dbo].[Equip_Fault] ADD CONSTRAINT [PK__Equip_Fa__3214EC07727DC100] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Equip_FaultData
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Equip_FaultData]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Equip_FaultData
-- ----------------------------
ALTER TABLE [dbo].[Equip_FaultData] ADD CONSTRAINT [PK__Equip_Fa__3214EC07E60ECCBC] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Equip_FaultEscalation
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Equip_FaultEscalation]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Equip_FaultEscalation
-- ----------------------------
ALTER TABLE [dbo].[Equip_FaultEscalation] ADD CONSTRAINT [PK__Equip_Fa__3214EC076DF8EBDA] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Equip_FaultStarLog
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Equip_FaultStarLog]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Equip_FaultStarLog
-- ----------------------------
ALTER TABLE [dbo].[Equip_FaultStarLog] ADD CONSTRAINT [PK__Equip_Fa__3214EC072BF10F11] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_MaintainPaper
-- ----------------------------
ALTER TABLE [dbo].[Equip_MaintainPaper] ADD CONSTRAINT [PK_Equip_MaintainPaper] PRIMARY KEY CLUSTERED ([MaintainPaperId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_SpotMaintenance
-- ----------------------------
ALTER TABLE [dbo].[Equip_SpotMaintenance] ADD CONSTRAINT [PK_Equip_SpotMaintenance] PRIMARY KEY CLUSTERED ([SpotMaintenanceId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_SpotMaintPlan
-- ----------------------------
ALTER TABLE [dbo].[Equip_SpotMaintPlan] ADD CONSTRAINT [PK_Equip_SpotMaintPlan] PRIMARY KEY CLUSTERED ([SpotMaintPlanId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_SpotMaintPlanDevice
-- ----------------------------
ALTER TABLE [dbo].[Equip_SpotMaintPlanDevice] ADD CONSTRAINT [PK_Equip_SpotMaintPlanDevice] PRIMARY KEY CLUSTERED ([SpotMaintPlanDeviceId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_SpotMaintPlanProject
-- ----------------------------
ALTER TABLE [dbo].[Equip_SpotMaintPlanProject] ADD CONSTRAINT [PK_Equip_SpotMaintPlanProject] PRIMARY KEY CLUSTERED ([SpotMaintPlanProjectId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Equip_SpotMaintWorkOrder
-- ----------------------------
ALTER TABLE [dbo].[Equip_SpotMaintWorkOrder] ADD CONSTRAINT [PK_Equip_SpotMaintWorkOrder] PRIMARY KEY CLUSTERED ([SpotMaintWorkOrderId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Equip_Status
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Equip_Status]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Equip_Status
-- ----------------------------
ALTER TABLE [dbo].[Equip_Status] ADD CONSTRAINT [PK__Equip_St__3214EC0782C0B241] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table FormCollectionObject
-- ----------------------------
ALTER TABLE [dbo].[FormCollectionObject] ADD CONSTRAINT [PK_FormCollectionList] PRIMARY KEY CLUSTERED ([FormCollectionId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table FormDesignOptions
-- ----------------------------
ALTER TABLE [dbo].[FormDesignOptions] ADD CONSTRAINT [PK_FormCollectionOptions] PRIMARY KEY CLUSTERED ([FormId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_AssembleWorkOrder
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_AssembleWorkOrder]', RESEED, 23)
GO


-- ----------------------------
-- Primary Key structure for table Production_AssembleWorkOrder
-- ----------------------------
ALTER TABLE [dbo].[Production_AssembleWorkOrder] ADD CONSTRAINT [PK_Production_AssembleWorkOrder] PRIMARY KEY CLUSTERED ([AssembleWorkOrder_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_AssembleWorkOrderList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_AssembleWorkOrderList]', RESEED, 63)
GO


-- ----------------------------
-- Primary Key structure for table Production_AssembleWorkOrderList
-- ----------------------------
ALTER TABLE [dbo].[Production_AssembleWorkOrderList] ADD CONSTRAINT [PK_Production_AssembleWorkOrderList] PRIMARY KEY CLUSTERED ([AssembleWorkOrderList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_InWareHouse
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_InWareHouse]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Production_InWareHouse
-- ----------------------------
ALTER TABLE [dbo].[Production_InWareHouse] ADD CONSTRAINT [PK__Producti__3214EC074519FEDA] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_InWareHouseDetail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_InWareHouseDetail]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Production_InWareHouseDetail
-- ----------------------------
ALTER TABLE [dbo].[Production_InWareHouseDetail] ADD CONSTRAINT [PK__Producti__3214EC07393FB7ED] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_MaterialPreparation
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_MaterialPreparation]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Production_MaterialPreparation
-- ----------------------------
ALTER TABLE [dbo].[Production_MaterialPreparation] ADD CONSTRAINT [PK__Producti__3214EC0784089FE7] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_MaterialRequisition
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_MaterialRequisition]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Production_MaterialRequisition
-- ----------------------------
ALTER TABLE [dbo].[Production_MaterialRequisition] ADD CONSTRAINT [PK__Producti__3214EC0786F879D9] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_MaterialRequisitionDetail
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_MaterialRequisitionDetail]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Production_MaterialRequisitionDetail
-- ----------------------------
ALTER TABLE [dbo].[Production_MaterialRequisitionDetail] ADD CONSTRAINT [PK__Producti__3214EC070F3EB1F5] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_ProductPlan
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_ProductPlan]', RESEED, 23)
GO


-- ----------------------------
-- Primary Key structure for table Production_ProductPlan
-- ----------------------------
ALTER TABLE [dbo].[Production_ProductPlan] ADD CONSTRAINT [PK_Production_ProductPlan] PRIMARY KEY CLUSTERED ([ProductPlan_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_ProductPlanList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_ProductPlanList]', RESEED, 51)
GO


-- ----------------------------
-- Primary Key structure for table Production_ProductPlanList
-- ----------------------------
ALTER TABLE [dbo].[Production_ProductPlanList] ADD CONSTRAINT [PK_Production_ProductPlanList] PRIMARY KEY CLUSTERED ([ProductPlanList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_QuarantineQty
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_QuarantineQty]', RESEED, 5)
GO


-- ----------------------------
-- Primary Key structure for table Production_QuarantineQty
-- ----------------------------
ALTER TABLE [dbo].[Production_QuarantineQty] ADD CONSTRAINT [PK__Producti__3214EC07DE5590D4] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_Report
-- ----------------------------
ALTER TABLE [dbo].[Production_Report] ADD CONSTRAINT [PK__Producti__3214EC07523FA11F] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_ReportWorkOrder
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_ReportWorkOrder]', RESEED, 58)
GO


-- ----------------------------
-- Primary Key structure for table Production_ReportWorkOrder
-- ----------------------------
ALTER TABLE [dbo].[Production_ReportWorkOrder] ADD CONSTRAINT [PK_Production_ReportWorkOrder] PRIMARY KEY CLUSTERED ([ReportWorkOrder_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_ReportWorkOrderList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_ReportWorkOrderList]', RESEED, 42)
GO


-- ----------------------------
-- Primary Key structure for table Production_ReportWorkOrderList
-- ----------------------------
ALTER TABLE [dbo].[Production_ReportWorkOrderList] ADD CONSTRAINT [PK_Production_ReportWorkOrderList] PRIMARY KEY CLUSTERED ([ReportWorkOrderList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_Rework
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_Rework]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Production_Rework
-- ----------------------------
ALTER TABLE [dbo].[Production_Rework] ADD CONSTRAINT [PK_Production_Rework] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_ReworkDetial
-- ----------------------------
ALTER TABLE [dbo].[Production_ReworkDetial] ADD CONSTRAINT [PK__Producti__3214EC07B4A1F617] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_ReworkQty
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_ReworkQty]', RESEED, 5)
GO


-- ----------------------------
-- Primary Key structure for table Production_ReworkQty
-- ----------------------------
ALTER TABLE [dbo].[Production_ReworkQty] ADD CONSTRAINT [PK__Producti__3214EC075702EBD0] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_SalesOrder
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_SalesOrder]', RESEED, 25)
GO


-- ----------------------------
-- Primary Key structure for table Production_SalesOrder
-- ----------------------------
ALTER TABLE [dbo].[Production_SalesOrder] ADD CONSTRAINT [PK_Production_SalesOrder] PRIMARY KEY CLUSTERED ([SalesOrder_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_SalesOrderList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_SalesOrderList]', RESEED, 71)
GO


-- ----------------------------
-- Primary Key structure for table Production_SalesOrderList
-- ----------------------------
ALTER TABLE [dbo].[Production_SalesOrderList] ADD CONSTRAINT [PK_Production_SalesOrderList] PRIMARY KEY CLUSTERED ([SalesOrderList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_Scrap
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_Scrap]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Production_Scrap
-- ----------------------------
ALTER TABLE [dbo].[Production_Scrap] ADD CONSTRAINT [PK__Producti__3214EC07B39EE9FB] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_ScrapDetial
-- ----------------------------
ALTER TABLE [dbo].[Production_ScrapDetial] ADD CONSTRAINT [PK__Producti__3214EC079BDB461B] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_ScrapQty
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_ScrapQty]', RESEED, 5)
GO


-- ----------------------------
-- Primary Key structure for table Production_ScrapQty
-- ----------------------------
ALTER TABLE [dbo].[Production_ScrapQty] ADD CONSTRAINT [PK__producti__3214EC0752FFE547] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_ScreenPrintPlateRecord
-- ----------------------------
ALTER TABLE [dbo].[Production_ScreenPrintPlateRecord] ADD CONSTRAINT [PK__Producti__3214EC07D1530A01] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_SizeRecord
-- ----------------------------
ALTER TABLE [dbo].[Production_SizeRecord] ADD CONSTRAINT [PK__Producti__3214EC07865C72C2] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_StatementDefect
-- ----------------------------
ALTER TABLE [dbo].[Production_StatementDefect] ADD CONSTRAINT [PK__Producti__3214EC07ABDB0227] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_StatementEfficiency
-- ----------------------------
ALTER TABLE [dbo].[Production_StatementEfficiency] ADD CONSTRAINT [PK__Producti__3214EC07913FB928] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Production_StockTaking
-- ----------------------------
ALTER TABLE [dbo].[Production_StockTaking] ADD CONSTRAINT [PK__Producti__3214EC0792077D07] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_WorkOrder
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_WorkOrder]', RESEED, 175)
GO


-- ----------------------------
-- Primary Key structure for table Production_WorkOrder
-- ----------------------------
ALTER TABLE [dbo].[Production_WorkOrder] ADD CONSTRAINT [PK_Production_WorkOrder] PRIMARY KEY CLUSTERED ([WorkOrder_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Production_WorkOrderList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Production_WorkOrderList]', RESEED, 405)
GO


-- ----------------------------
-- Primary Key structure for table Production_WorkOrderList
-- ----------------------------
ALTER TABLE [dbo].[Production_WorkOrderList] ADD CONSTRAINT [PK_Production_WorkOrderList] PRIMARY KEY CLUSTERED ([WorkOrderList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_Defect
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_Defect]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Quality_Defect
-- ----------------------------
ALTER TABLE [dbo].[Quality_Defect] ADD CONSTRAINT [PK_Quality_Defect] PRIMARY KEY CLUSTERED ([DefectId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_GbExtract
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_GbExtract]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Quality_GbExtract
-- ----------------------------
ALTER TABLE [dbo].[Quality_GbExtract] ADD CONSTRAINT [PK__Quality___3214EC07456FF073] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_InComingCheck
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_InComingCheck]', RESEED, 6)
GO


-- ----------------------------
-- Primary Key structure for table Quality_InComingCheck
-- ----------------------------
ALTER TABLE [dbo].[Quality_InComingCheck] ADD CONSTRAINT [PK_Quality_InComingCheck] PRIMARY KEY CLUSTERED ([InComingCheckId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_InComingCheckTestItem
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_InComingCheckTestItem]', RESEED, 4)
GO


-- ----------------------------
-- Primary Key structure for table Quality_InComingCheckTestItem
-- ----------------------------
ALTER TABLE [dbo].[Quality_InComingCheckTestItem] ADD CONSTRAINT [PK_Quality_InComingCheckTestItem_1] PRIMARY KEY CLUSTERED ([InComingCheckTestItemId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_OutCheck
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_OutCheck]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Quality_OutCheck
-- ----------------------------
ALTER TABLE [dbo].[Quality_OutCheck] ADD CONSTRAINT [PK_Quality_OutCheck] PRIMARY KEY CLUSTERED ([OutCheckId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_OutCheckTestItem
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_OutCheckTestItem]', RESEED, 2)
GO


-- ----------------------------
-- Primary Key structure for table Quality_OutCheckTestItem
-- ----------------------------
ALTER TABLE [dbo].[Quality_OutCheckTestItem] ADD CONSTRAINT [PK_Quality_OutCheckTestItem] PRIMARY KEY CLUSTERED ([OutCheckTestItemId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_ProcessCheck
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_ProcessCheck]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Quality_ProcessCheck
-- ----------------------------
ALTER TABLE [dbo].[Quality_ProcessCheck] ADD CONSTRAINT [PK_Quality_ProcessCheck] PRIMARY KEY CLUSTERED ([ProcessCheckId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_ProcessCheckTestItem
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_ProcessCheckTestItem]', RESEED, 3)
GO


-- ----------------------------
-- Primary Key structure for table Quality_ProcessCheckTestItem
-- ----------------------------
ALTER TABLE [dbo].[Quality_ProcessCheckTestItem] ADD CONSTRAINT [PK_Quality_ProcessCheckTestItem] PRIMARY KEY CLUSTERED ([ProcessCheckTestItemId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_Template
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_Template]', RESEED, 8)
GO


-- ----------------------------
-- Primary Key structure for table Quality_Template
-- ----------------------------
ALTER TABLE [dbo].[Quality_Template] ADD CONSTRAINT [PK_Quality_Template] PRIMARY KEY CLUSTERED ([TemplateId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_TemplateProduct
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_TemplateProduct]', RESEED, 13)
GO


-- ----------------------------
-- Primary Key structure for table Quality_TemplateProduct
-- ----------------------------
ALTER TABLE [dbo].[Quality_TemplateProduct] ADD CONSTRAINT [PK_Quality_TemplateProduct] PRIMARY KEY CLUSTERED ([TemplateProductId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_TemplateTestItem
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_TemplateTestItem]', RESEED, 20)
GO


-- ----------------------------
-- Primary Key structure for table Quality_TemplateTestItem
-- ----------------------------
ALTER TABLE [dbo].[Quality_TemplateTestItem] ADD CONSTRAINT [PK_Quality_TemplateTestItem] PRIMARY KEY CLUSTERED ([TemplateTestItemId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Quality_TestItem
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Quality_TestItem]', RESEED, 6)
GO


-- ----------------------------
-- Primary Key structure for table Quality_TestItem
-- ----------------------------
ALTER TABLE [dbo].[Quality_TestItem] ADD CONSTRAINT [PK_Quality_TestItem] PRIMARY KEY CLUSTERED ([TestItemId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_City
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_City]', RESEED, 345)
GO


-- ----------------------------
-- Primary Key structure for table Sys_City
-- ----------------------------
ALTER TABLE [dbo].[Sys_City] ADD CONSTRAINT [PK_Sys_City] PRIMARY KEY CLUSTERED ([CityId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_Dept
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_Dept]', RESEED, 8)
GO


-- ----------------------------
-- Primary Key structure for table Sys_Dept
-- ----------------------------
ALTER TABLE [dbo].[Sys_Dept] ADD CONSTRAINT [PK_Sys_Dept] PRIMARY KEY CLUSTERED ([Dept_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_Dictionary
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_Dictionary]', RESEED, 121)
GO


-- ----------------------------
-- Primary Key structure for table Sys_Dictionary
-- ----------------------------
ALTER TABLE [dbo].[Sys_Dictionary] ADD CONSTRAINT [PK_Sys_Dictionary] PRIMARY KEY CLUSTERED ([Dic_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_DictionaryList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_DictionaryList]', RESEED, 590)
GO


-- ----------------------------
-- Primary Key structure for table Sys_DictionaryList
-- ----------------------------
ALTER TABLE [dbo].[Sys_DictionaryList] ADD CONSTRAINT [PK_Sys_DictionaryList] PRIMARY KEY CLUSTERED ([DicList_ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_Log
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_Log]', RESEED, 68737)
GO


-- ----------------------------
-- Primary Key structure for table Sys_Log
-- ----------------------------
ALTER TABLE [dbo].[Sys_Log] ADD CONSTRAINT [PK_Sys_Log] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_Menu
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_Menu]', RESEED, 245)
GO


-- ----------------------------
-- Primary Key structure for table Sys_Menu
-- ----------------------------
ALTER TABLE [dbo].[Sys_Menu] ADD CONSTRAINT [PK_Sys_Menu] PRIMARY KEY CLUSTERED ([Menu_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_Province
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_Province]', RESEED, 43)
GO


-- ----------------------------
-- Primary Key structure for table Sys_Province
-- ----------------------------
ALTER TABLE [dbo].[Sys_Province] ADD CONSTRAINT [PK_Sys_Province] PRIMARY KEY CLUSTERED ([ProvinceId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Sys_QuartzLog
-- ----------------------------
ALTER TABLE [dbo].[Sys_QuartzLog] ADD CONSTRAINT [PK__Sys_Quar__5E54864815AC1510] PRIMARY KEY CLUSTERED ([LogId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Sys_QuartzOptions
-- ----------------------------
ALTER TABLE [dbo].[Sys_QuartzOptions] ADD CONSTRAINT [PK__Sys_Quar__3214EC071E78A418] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_Role
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_Role]', RESEED, 21)
GO


-- ----------------------------
-- Primary Key structure for table Sys_Role
-- ----------------------------
ALTER TABLE [dbo].[Sys_Role] ADD CONSTRAINT [PK_Sys_Role] PRIMARY KEY CLUSTERED ([Role_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_RoleAuth
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_RoleAuth]', RESEED, 416)
GO


-- ----------------------------
-- Primary Key structure for table Sys_RoleAuth
-- ----------------------------
ALTER TABLE [dbo].[Sys_RoleAuth] ADD CONSTRAINT [PK_Sys_RoleAuth] PRIMARY KEY CLUSTERED ([Auth_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_TableColumn
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_TableColumn]', RESEED, 2101)
GO


-- ----------------------------
-- Primary Key structure for table Sys_TableColumn
-- ----------------------------
ALTER TABLE [dbo].[Sys_TableColumn] ADD CONSTRAINT [PK_Sys_TableColumn] PRIMARY KEY CLUSTERED ([ColumnId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_TableInfo
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_TableInfo]', RESEED, 183)
GO


-- ----------------------------
-- Primary Key structure for table Sys_TableInfo
-- ----------------------------
ALTER TABLE [dbo].[Sys_TableInfo] ADD CONSTRAINT [PK_Sys_TableInfo] PRIMARY KEY CLUSTERED ([Table_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_Unit
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_Unit]', RESEED, 15)
GO


-- ----------------------------
-- Primary Key structure for table Sys_Unit
-- ----------------------------
ALTER TABLE [dbo].[Sys_Unit] ADD CONSTRAINT [PK_Sys_Unit] PRIMARY KEY CLUSTERED ([Unit_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_User
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_User]', RESEED, 4405)
GO


-- ----------------------------
-- Primary Key structure for table Sys_User
-- ----------------------------
ALTER TABLE [dbo].[Sys_User] ADD CONSTRAINT [PK_Sys_User] PRIMARY KEY CLUSTERED ([User_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Sys_VersionInfo
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Sys_VersionInfo]', RESEED, 6)
GO


-- ----------------------------
-- Primary Key structure for table Sys_VersionInfo
-- ----------------------------
ALTER TABLE [dbo].[Sys_VersionInfo] ADD CONSTRAINT [PK_Sys_VersionInfo] PRIMARY KEY CLUSTERED ([VersionInfo_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Sys_WorkFlow
-- ----------------------------
ALTER TABLE [dbo].[Sys_WorkFlow] ADD CONSTRAINT [PK__Sys_Work__2A1726C38AD06D4D] PRIMARY KEY CLUSTERED ([WorkFlow_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Sys_WorkFlowStep
-- ----------------------------
ALTER TABLE [dbo].[Sys_WorkFlowStep] ADD CONSTRAINT [PK__Sys_Work__26A928370FFD6659] PRIMARY KEY CLUSTERED ([WorkStepFlow_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Sys_WorkFlowTable
-- ----------------------------
ALTER TABLE [dbo].[Sys_WorkFlowTable] ADD CONSTRAINT [PK__Sys_Work__E731D35B8DAE74D6] PRIMARY KEY CLUSTERED ([WorkFlowTable_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Sys_WorkFlowTableStep
-- ----------------------------
ALTER TABLE [dbo].[Sys_WorkFlowTableStep] ADD CONSTRAINT [PK__Sys_Work__2CBB561BDE0F2FDA] PRIMARY KEY CLUSTERED ([Sys_WorkFlowTableStep_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Ald
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Ald]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Ald
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Ald] ADD CONSTRAINT [SYS_C007956] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Bdm
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Bdm]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Bdm
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Bdm] ADD CONSTRAINT [SYS_C007958] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Bsg
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Bsg]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Bsg
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Bsg] ADD CONSTRAINT [PK_Tbl_DataClear_Bsg] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_BsgJP
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_BsgJP] ADD CONSTRAINT [SYS_C007972] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Lks
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Lks]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Lks
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Lks] ADD CONSTRAINT [SYS_C007944] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Lpcvd
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Lpcvd]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Lpcvd
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Lpcvd] ADD CONSTRAINT [SYS_C007953] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Pks
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Pks]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Pks
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Pks] ADD CONSTRAINT [SYS_C007947] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Poly
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Poly]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Poly
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Poly] ADD CONSTRAINT [SYS_C007950] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Psgjp
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Psgjp]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Psgjp
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Psgjp] ADD CONSTRAINT [SYS_C007975] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Se
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Se]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Se
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Se] ADD CONSTRAINT [PK_Tbl_DataClear_Se] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swhc1
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swhc1]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swhc1
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swhc1] ADD CONSTRAINT [SYS_C007989] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swhc2
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swhc2]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swhc2
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swhc2] ADD CONSTRAINT [SYS_C007993] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swhc3
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swhc3]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swhc3
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swhc3] ADD CONSTRAINT [SYS_C007997] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swhx1
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swhx1]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swhx1
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swhx1] ADD CONSTRAINT [SYS_C008000] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swhx2
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swhx2]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swhx2
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swhx2] ADD CONSTRAINT [SYS_C008004] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swhx3
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swhx3]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swhx3
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swhx3] ADD CONSTRAINT [SYS_C008008] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swsj
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swsj]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swsj
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swsj] ADD CONSTRAINT [SYS_C008012] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swys1
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swys1]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swys1
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swys1] ADD CONSTRAINT [SYS_C007977] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swys2
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swys2]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swys2
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swys2] ADD CONSTRAINT [SYS_C007980] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swys3
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swys3]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swys3
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swys3] ADD CONSTRAINT [SYS_C007983] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Swys4
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Swys4]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Swys4
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Swys4] ADD CONSTRAINT [SYS_C007986] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Zdm
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Zdm]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Zdm
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Zdm] ADD CONSTRAINT [SYS_C007961] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_DataClear_Zr
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_DataClear_Zr]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_DataClear_Zr
-- ----------------------------
ALTER TABLE [dbo].[Tbl_DataClear_Zr] ADD CONSTRAINT [SYS_C007942] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Package_Box
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Package_Box]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Package_Box
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Package_Box] ADD CONSTRAINT [SYS_C007933] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Package_Carton
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Package_Carton]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Package_Carton
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Package_Carton] ADD CONSTRAINT [SYS_C007940] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Package_Template
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Package_Template]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Package_Template
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Package_Template] ADD CONSTRAINT [SYS_C007935] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Trace_BoxWafer
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Trace_BoxWafer]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Trace_BoxWafer
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Trace_BoxWafer] ADD CONSTRAINT [SYS_C008014] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Trace_FlowCard
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Trace_FlowCard]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Trace_FlowCard
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Trace_FlowCard] ADD CONSTRAINT [SYS_C007931] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Trace_FlowMaterial
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Trace_FlowMaterial]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Trace_FlowMaterial
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Trace_FlowMaterial] ADD CONSTRAINT [SYS_C007927] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Trace_FlowTrace
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Trace_FlowTrace]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Trace_FlowTrace
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Trace_FlowTrace] ADD CONSTRAINT [SYS_C007929] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Trace_Wafer
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Trace_Wafer]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Trace_Wafer
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Trace_Wafer] ADD CONSTRAINT [SYS_C007963] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tbl_Trace_WaferTrace
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tbl_Trace_WaferTrace]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tbl_Trace_WaferTrace
-- ----------------------------
ALTER TABLE [dbo].[Tbl_Trace_WaferTrace] ADD CONSTRAINT [SYS_C007965] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Tools_Tool
-- ----------------------------
ALTER TABLE [dbo].[Tools_Tool] ADD CONSTRAINT [PK_Tools_Tool] PRIMARY KEY CLUSTERED ([ToolId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tools_ToolsReceive
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tools_ToolsReceive]', RESEED, 14)
GO


-- ----------------------------
-- Primary Key structure for table Tools_ToolsReceive
-- ----------------------------
ALTER TABLE [dbo].[Tools_ToolsReceive] ADD CONSTRAINT [PK_Tools_ToolsReceive] PRIMARY KEY CLUSTERED ([ToolsReceiveId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tools_ToolsReceiveList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tools_ToolsReceiveList]', RESEED, 17)
GO


-- ----------------------------
-- Primary Key structure for table Tools_ToolsReceiveList
-- ----------------------------
ALTER TABLE [dbo].[Tools_ToolsReceiveList] ADD CONSTRAINT [PK_Tools_ToolsReceiveList] PRIMARY KEY CLUSTERED ([ToolsReceiveListId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tools_ToolsReturn
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tools_ToolsReturn]', RESEED, 1)
GO


-- ----------------------------
-- Primary Key structure for table Tools_ToolsReturn
-- ----------------------------
ALTER TABLE [dbo].[Tools_ToolsReturn] ADD CONSTRAINT [PK_Tools_ToolsReturn] PRIMARY KEY CLUSTERED ([ToolsReturnId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Tools_ToolsReturnList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Tools_ToolsReturnList]', RESEED, 2)
GO


-- ----------------------------
-- Primary Key structure for table Tools_ToolsReturnList
-- ----------------------------
ALTER TABLE [dbo].[Tools_ToolsReturnList] ADD CONSTRAINT [PK_Tools_ToolsReturnList] PRIMARY KEY CLUSTERED ([ToolsReturnListId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table Tools_ToolType
-- ----------------------------
ALTER TABLE [dbo].[Tools_ToolType] ADD CONSTRAINT [PK_Tools_ToolType] PRIMARY KEY CLUSTERED ([ToolTypeId])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Ware_OutWareHouseBill
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Ware_OutWareHouseBill]', RESEED, 22)
GO


-- ----------------------------
-- Primary Key structure for table Ware_OutWareHouseBill
-- ----------------------------
ALTER TABLE [dbo].[Ware_OutWareHouseBill] ADD CONSTRAINT [PK_Ware_OutWareHouseBill] PRIMARY KEY CLUSTERED ([OutWareHouseBill_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Ware_OutWareHouseBillList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Ware_OutWareHouseBillList]', RESEED, 42)
GO


-- ----------------------------
-- Primary Key structure for table Ware_OutWareHouseBillList
-- ----------------------------
ALTER TABLE [dbo].[Ware_OutWareHouseBillList] ADD CONSTRAINT [PK_Ware_OutWareHouseBillList] PRIMARY KEY CLUSTERED ([OutWareHouseBillList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Ware_WareHouseBill
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Ware_WareHouseBill]', RESEED, 66)
GO


-- ----------------------------
-- Primary Key structure for table Ware_WareHouseBill
-- ----------------------------
ALTER TABLE [dbo].[Ware_WareHouseBill] ADD CONSTRAINT [PK_Ware_WareHouseBill] PRIMARY KEY CLUSTERED ([WareHouseBill_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Auto increment value for Ware_WareHouseBillList
-- ----------------------------
DBCC CHECKIDENT ('[dbo].[Ware_WareHouseBillList]', RESEED, 189)
GO


-- ----------------------------
-- Primary Key structure for table Ware_WareHouseBillList
-- ----------------------------
ALTER TABLE [dbo].[Ware_WareHouseBillList] ADD CONSTRAINT [PK_Ware_WareHouseBillList] PRIMARY KEY CLUSTERED ([WareHouseBillList_Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

